EXISTS v11
The EXISTS
method verifies that a subscript exists within a collection. EXISTS
returns TRUE
if the subscript exists; if the subscript does not exist, EXISTS
returns FALSE
. The method takes a single argument; the subscript
that you are testing for. The syntax is:
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
.
The following example verifies that subscript number 10
exists within the associative array:
Some collection methods raise an exception if you call them with a subscript that does not exist within the specified collection. Rather than raising an error, the EXISTS
method returns a value of FALSE
.