EXISTS v15
The EXISTS
method verifies that a subscript exists in a collection. EXISTS
returns TRUE
if the subscript exists. If the subscript doesn't exist, EXISTS
returns FALSE
. The method takes a single argument: the subscript
that you are testing for. The syntax is:
Where:
collection
is the name of the collection.
subscript
is the value that you are testing for. If you specify a value of NULL
, EXISTS
returns false
.
This example verifies that subscript number 10
exists in the associative array:
Some collection methods raise an exception if you call them with a subscript that doesn't exist in the specified collection. Rather than raising an error, the EXISTS
method returns a value of FALSE
.