Consultor Eletrônico



Kbase P37332: How to use the COMBO-BOX INSERT() method to add an item at t
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/15/2003
Status: Unverified

GOAL:

How to use the COMBO-BOX INSERT() method to add an item at the end of the list?

FIX:

Unlike the ADD-LAST() method that sorts the new items by label before adding them to the widget if the widget's SORT attribute is TRUE, the INSERT() method adds elements without sorting.

The following code samples illustrate two ways of using the INSERT() method to add a new item at the end of the COMBO-BOX list. The first uses the COMBO-BOX object handle and the second uses its name:

/* 1. Using the COMBO-BOX object handle */
DEFINE VARIABLE hHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE lLogical AS LOGICAL NO-UNDO.
hHandle = ComboBoxName:HANDLE.
lLogical = h:INSERT("a new item", h:NUM-ITEMS + 1).

OR

/* 2. Using the COMBO-BOX object name */
DEFINE VARIABLE h AS HANDLE NO-UNDO.
DEFINE VARIABLE l AS LOGICAL NO-UNDO.
hHandle = ComboBoxName:HANDLE.
lLogical = ComboBoxName:INSERT("a new item", ComboBoxName:NUM-ITEMS + 1).