FindString Method (COMBOBOX / DATALIST)
PLBCMP GUI Only
The FindString method locates a string within a DATALIST or COMBOBOX object that begins with a specified prefix. The method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A DATALIST or COMBOBOX object that is searched.
return
Optional. A Numeric Variable that returns the zero-based index the matching item in the list.
string
Required. A Character String Variable that specifies the prefix of the string.
index
Required. A decimal number or Numeric Variable that indicates the item after 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}.
The currently selected item is not changed by this method.
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 SelectString method to find a string and select the item.
See Also: Method Syntax, DATALIST Methods, COMBOBOX Methods
![]() |