Functions Index :: A :: ArrayIndexOf

[<< up one level]

Module:

array :: properties

Definition:

ArrayIndexOf(string array, val value, int "start_from")

Description:

Returns the (first) index of array that contains the specified value.

The start_from optional argument (defaults to 0) determines the index from which searching will start.

If no match is found the function returns -1.

Examples:

a = ArrayCreate(2,3,4,5,2,4)

n1 = a.ArrayIndexOf(2) # n1 == 0

n2 = a.ArrayIndexOf(4) # n2 == 2

n3 = a.ArrayIndexOf(2,1) # n3 == 4

n4 = a.ArrayIndexOf(0) # n4 == -1

 

[<< top]