Function: aindex

Syntax

aindex (<value>,<array> {... <array} )

Type

numeric

Returns

The occurrences of one value within an array of values of similar type. If occurrences are found, one or more array indices, starting at one, are returned, otherwise zero is returned. When the identifier type is of type string, the search is case-insensitive.

Parameters

Examples

The following returns two values: 2 and 5.

numeric xx[] = <2,5,6,8,5>
numeric i[] = aindex(5,xx)

Since the destination is a scalar, the following returns one value: 2.

numeric i = aindex(5,xx)

The following returns three values: 1, 4 and 5.

string ss[] = <'aa','bb','bb','AA','aa'>
numeric i[] = aindex('aa',ss)

See Also

Functions:

aindexc (string), aindexcw (string), aindexw (string)