SetCurSel Method (COMBOBOX / DATALIST)


PLBCMP GUI Only

 

The SetCurSel method highlights a string within the given DATALIST or COMBOBOX object. The method uses the following format:

 

[label]

{object}.SetCurSel

[GIVING {return}] USING [*Index=]{index}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A DATALIST or COMBOBOX object that is accessed.

return

Optional. A Numeric Variable that indicates the success or failure of the method.

index

Required. A decimal number or Numeric Variable that indicates the zero-based item to select.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The MULTISELECT property of the object must be cleared.

  2. If another item was previously selected, its selection is removed.

  3. {index} is a zero-based number indicating the item within the object to select. If {index} is -1, the action is applied to all items in the object.

  4. Upon completion, {return} will contain the status of the method as follows. $TRUE and $FALSE are defined in PLBEQU.INC:

  5.  

    Value

    Constant

    The selection ...

    0

    $FALSE

    failed.

    1

    $TRUE

    was successful.

 

  1. If the value returned is zero, the ZERO Condition Flag is set.

  2. The OVER and EOS Condition Flags are always cleared.

  3. For improved performance in the Application Server environment, do not specify the optional return value unless needed.

 

 

See Also: Method Syntax, DATALIST Methods, COMBOBOX Methods

 



PL/B Language Reference SetCBFlags Method (COMBOBOX) SetItemData Method (COMBOBOX / DATALIST)