![Okuma OSP-P200L Programming Manual Download Page 301](http://html1.mh-extra.com/html/okuma/osp-p200l/osp-p200l_programming-manual_3667818301.webp)
5238-E P-288
SECTION 12 USER TASK
4-1-2. RTS Statement - End of Subprogram
[Program Format]
LE33013R0301400310001
[Function]
This RTS statement must always be specified at the end of a subprogram. Executing the RTS block
ends the called subprogram and the execution sequence jumps to the block right after the one
containing the CALL statement. The variables registered in the block containing the CALL
statement and the variables in the subprogram are all cleared.
Judging defined/undefined state of local variables with an IF statement
LE33013R0301400320001
This checks whether the local variable name designated is defined or not. A jump is made to the
designated sequence name, N3, if it is defined; if it is not defined the block which follows this N2
block will be executed.
Example 1:
LE33013R0301400320002
If local variable ABC has been defined, sequence execution jumps to N2000. If it has not been
defined, the next block is executed.
N0
RTS
The sequence name of this block (can be omitted)
Indicates an RTS statement
N2
IF
Local variable name
GOTO
N3
Sequence name of this block
Designates an IF statement
Name of the local variable whose defined/undefined status is under investigation
There is no need to enclose the local variable name in square brackets.
This can be omitted
Specify here the block sequence name that is
the jump destination if the local variable is
found to be defined.
N1000
IF ABC
N2000