SelectString Method (COMBOBOX / DATALIST)
PLBCMP GUI Only
The SelectString method searches for a DATALIST or COMBOBOX item that matches the specified string, and if a matching item is found, it selects the item. The method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A DATALIST or COMBOBOX object that is accessed.
return
Optional. A Numeric Variable that returns the index of the matching item.
string
Required. A Character String Variable or literal that specifies the prefix of the string to be found.
index
Required. A decimal number or Numeric Variable that indicates the zero-based item from which to start the search.
Flags Affected: EOS, OVER, ZERO
Note the following:
{string} contains the prefix of the item to locate.
The search is not case sensitive.
When the search reaches the bottom of the list, it continues from the top of the list back to the item specified by {index}. To start with item number zero (0), define {index} as a FORM field with a value of -1. The first eligible item for a match is the next item after that specified by {index}.
An item is selected only if its initial characters (from the starting point) match the characters in the string specified by {string}.
The located string becomes the currently selected item.
The object is scrolled, if necessary, to bring the selected item into view.
If the method is successful, the zero-based index of the matching item is returned. If the method is not successful, {return} will contain a -1.
If the value returned is zero, the ZERO Condition Flag is set.
If {return} is too small to contain the string index, the OVER Condition Flag is set.
The EOS Condition Flag is always cleared.
Use the FindString method to find a string without selecting the item.
See Also: Method Syntax, DATALIST Methods, COMBOBOX Methods
![]() |