decr/4—return an integer or enumeration slot value decremented by a specified value within a given limit

The decr/4 operation returns an integer or enumeration slot value decremented by a specified value within a given limit. The general syntax for the decr/4 operation is as follows:

$VAL=decr($SLOT,$DECR,$LIMIT)

decr/4 arguments

Argument

Mode

Type

Description

$SLOT

Input

SLOTREF

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

$DECR

Input

INTEGER

Specifies the number by which the slot value returned in $VAL is to be decremented

$LIMIT

Input

INTEGER|ENUM

Specifies the limit to which the slot value returned in $VAL is to be decremented

$VAL

Output

INTEGER|ENUM

Value of the slot decremented by $DECR

Use decr/4 to return the value of the slot specified in $SLOT decremented by $DECR, limited to the value $LIMIT in $VAL. For an enumeration, the slot value returned is decremented to the $DECR next lower value, limited to $LIMIT.

The referenced slot itself is not modified.

decr/4 example

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

Comments