Download RAPID reference manual

Transcript
Decr
Instruction
RobotWare-OS
Decr - Decrements by 1
Decr is used to subtract 1 from a numeric variable or persistent.
Example
Decr reg1;
1 is subtracted from reg1, i.e. reg1:=reg1-1.
Arguments
Decr
Name
Name
Data type: num
The name of the variable or persistent to be decremented.
Example
TPReadNum no_of_parts, "How many parts should be produced? ";
WHILE no_of_parts>0 DO
produce_part;
Decr no_of_parts;
ENDWHILE
The operator is asked to input the number of parts to be produced. The variable
no_of_parts is used to count the number that still have to be produced.
Syntax
Decr [ Name ’:=’ ] < var or pers (INOUT) of num > ’;’
RAPID reference manual - part 1a, Instructions A-R
81