Mitsubishi MELFA CR1D Instruction Manual page 216

Table of Contents

Advertisement

4MELFA-BASIC IV
GoSub (Return)(Go Subroutine)
[Function]
Calls up the subroutine at the designated step label. Be sure to return from the jump destination using the
Return instruction.
[Format]
GoSub[]<Call Destination>
[Terminology]
<Call Destination> Describe the step label name.
[Reference Program]
1 GoSub *LBL
2 End
:
20 *LBL
21 Mov P1
22 Return
[Explanation]
(1) Make sure to return from the subroutine by using the Return command. If return by GoTo command, the
memory for control structure (stack memory) will decrease, and it will cause the error at continuous exe-
cuting.
(2) The call of other subroutines is possible again by the GoSub command out of the subroutine. This
approach can be employed approximately up to 800 times.
(3) When the step or label of the call place does not exist, it becomes the execution-time error.
[Related instructions]
Return (Return)
4-203 Detailed explanation of command words
' Be sure to use the Return instruction to return.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents