Matt
If %arrayName(#?%variable) Matches 0
Can't remember if you can have a variable name with #?.
>
> What is #?
From the user guide -- variables--
If the four variables %arr1, %arr2, %arr3, %arr4 hold respectively a, b, c and d then we have an array with 4 elements. These variables can be used just like any other,however it is also possible to access them in special ways.
%arr(#?b/c) A comma-separated list of the array indices (lowest to highest) with matching values,or 0 if none match (2,3 in the example)
It is very useful but easily missed in the user guide. As Matt pointed out it will throw a error when using a local array but it does work with global arrays or with Matts suggested work around.
Rich..