Skip to main content
Previous sectionNext section

$NEXT

Returns the value of the next subscript in a subscripted variable.

Synopsis

$NEXT(variable)
$N(variable)

Parameter

Argument Description
variable The array subscript to be used to determine the next existing subscript value.

Description

$NEXT returns the value of the next subscript in the subscripted variable. It can be either a local or global subscripted array element. The value of the rightmost subscript must be a number whose value is -1 or greater. If you are using a naked global reference, the naked indicator must be defined.

$NEXT is an obsolete function that has been superseded by the $ORDER function. It is documented here only for completeness.

Note:

Do not use $NEXT in any new code. Use $ORDER in place of $NEXT to retrieve subscripts of an array.

Notes

$NEXT and $ORDER

$NEXT is similar to $ORDER. Both return the subscripts of the next sibling in collating order to the specified node. However, $NEXT and $ORDER have different start and failure codes, as follows:

$NEXT $ORDER
Starting point -1 Null string
Failure code -1 Null String

See Also

$ORDER function