decr/3—retrieve the value of an integer or enumeration slot decremented by a specified value
The decr/3 operation retrieves the value of an integer or enumeration slot decremented by a specified value. The syntax for the decr/3 operation is as follows:
decr/3 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$SLOT | Input | SLOTREF | Specifies an integer or enumeration slot for which the decremented value is to be returned. |
$DECR | Input | INTEGER | Specifies the number by which the slot value returned in $VAL is to be decremented |
$VAL | Output | INTEGER|ENUM | Value of the slot decremented by $DECR |
Use decr/3 to retrieve the value of the slot referenced in $SLOT decremented by $DECR in $VAL. For an enumeration, the slot value is decremented to the $DECR next lower value. If there are no $DECR lower values, the slot value is decremented to the lowest value.
The referenced slot itself is not modified.
decr/3 example