PRIOR v16
The PRIOR
method returns the subscript that precedes a specified subscript in a collection.
Syntax
The method takes a single argument: the subscript
that you are testing for. The syntax is:
Where collection
is the name of the collection.
If the subscript specified doesn't have a predecessor, PRIOR
returns NULL
. If the specified subscript is greater than the last subscript in the collection, the method returns the last subscript. If you specify a NULL
subscript, PRIOR
doesn't return a value.
Example
This example returns the subscript that precedes subscript 100
in the associative array sparse_arr: