FIND

Use the FIND script function to search a script array, and return the corresponding index position.

Syntax

FIND (script array, string [, start index] )

Parameters


Return Codes

Notes:

Tips:

For more information about script arrays, see Arrays.

Examples

The following example creates and initializes an array with VARA object values. The script searches for the string WIN in the complete array. The results are written in the activation report.

:DEFINE &array#, string, 5
:FILL &array#[] = GET_VAR(VARA.WIN, AGENTS)
:SET &search# = FIND(&array#[], "WIN", 1)
:WHILE &search# <> 0
:PRINT "WIN found at position &search#"
:SET &search# = &search# + 1

:SET &search# = FIND(&array#[], "WIN", &search#)
:ENDWHILE

See also: