11 - 81 11 - 81
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Example using a subroutine
20 PRINT "At line 10 of the main routine"
30 GOSUB 100
: ' Branches to a subroutine
40 PRINT
50 PRINT "At line 50 of the main routine"
60 END
:
' End of execution
100 PRINT
110 PRINT "Entered the subroutine"
120 RETURN
:
' Returns to the main routine
RUN
At line 10 of the main routine
Entered the subroutine
At line 50 of the main routine
OK
REMARK
See Section 3.9.