incr/3—return an integer or enumeration slot value incremented by a specified value

The general syntax for the incr/3 operation is as follows: 

$VAL=incr($SLOT,$INCR)

incr/3 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 slot value is not incremented.

$INCR

Input

INTEGER

Specifies the number by which the slot value is to be incremented when it is returned in $VAL

$VAL

Output

INTEGER|ENUM

Value of the slot incremented by $INCR

Use incr/3 to retrieve the value of the slot referenced in $SLOT incremented by $INCR in $VAL. For an enumeration, the slot value returned is incremented by $INCR higher values. If there are not $INCR higher values, then the slot value returned is incremented to the highest value available.

The referenced slot itself is not modified.

incr/3 example

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

Comments