The arraycontains( function checks to see if any element of a text array or a data array matches a specified value.


This function has three parameters:

array – the text array or data array to be searched (see Text Arrays and Data Arrays).

value – the value to search for.

separator – the separator character or characters for this array (omit this parameter for data arrays).


This function checks to see if any element of an array matches a specified value. The array element must match the specified value exactly, including upper and lower case. So checking for "Green" will only match that exact array element, not "green" or "Olive Green". (Note that this is quite different from the contains operator, which ignores upper and lower case and allows a submatch.)

arraycontains("Red;Green;Blue","Green",";") ☞ -1 (true)
arraycontains("Red;Green;Blue","Yellow",";") ☞ 0 (false)

Note: This function is equivalent to:


Working with a Data Array

This function works with both data and text arrays. Because Data Arrays have no separators between elements, the separator parameter is omitted when targeting a data array.

Suppose we have a data array, myDataArray, defined as below (noting that a data array can contain text, numeric, binary and other data types):

myDataArray = dataarray("Bob",123,3.14159,"Green")


arraycontains(myDataArray,5) ☞ 0 (false)
arraycontains(myDataArray,123) ☞ -1 (true)

See Also


10.0UpdatedCarried over from Panorama 6.0 but more than one character is now allowed for use as the separator parameter.