p$TDV:Util:ArrayInd
p$TDV:Util:ArrayInd
Determination of the index in the given array matching the input text. If the array does not contain the text, -1 is returned.
This function is suitable if an input, or a selection in a dialog screen is to be checked against a list of values. In case of a list array for example the text of a selected entry will be returned. p$TDV:Util:ArrayIndx can be used to determine the index of this data source.
Please note: the array name is usually given as a string constants, i.e. in quotation marks. Furthermore the array has to be global!
Syntax: | Index = p$TDV:Util:ArrayInd( Text, ArrayName, MaxIndex ) | ||
| Argument | Type | Meaning |
| Text | String | Array content to be searched for (always as a string!) |
| Array name | String | Name of the string array to be searched for as a string |
| Number | Integer | Maximum array index to be searched |
Result: | Integer | Index of the searched array element, or -1 | |
Example: | The array assembly is to be given by: Assembly[1] = 'Pump' Then the command Index = p$TDV:Util:ArrayIndx( 'Engine', 'Assembly', 3) returns: Index = 2 | ||