incr/2 and next/2—return an integer or enumeration slot value incremented by 1

The incr/2 and next/2 operations return an integer or enumeration slot value incremented by 1.

Note

The next/2 function has the same functionality as incr/2 but is used only on enumeration type slots. This function has been deprecated.

incr/2 arguments

Argument

Mode

Type

Description

$SLOT

Input

SLOTREF

Specifies an integer or enumeration slot for which the incremented value is to be returned
The actual value of the slot is not incremented.

$VAL

Output

INTEGER|ENUM

Value of the slot incremented by 1

Use incr/2 to return the value of the slot referenced in $SLOT incremented by 1 in the $VAL argument. For an enumeration, the value of the slot is returned as the next higher value. If there is no higher value, the value of the slot that is returned in $VAL is not modified.

The referenced slot itself is not modified.

incr/2 example

$NEWPRIO = incr( $E.mc_priority );
Was this page helpful? Yes No Submitting... Thank you

Comments