Mitsubishi MELFA CR1D Instruction Manual page 172

Table of Contents

Advertisement

4MELFA-BASIC IV
[Explanation]
(1) A program (sub program) called by the CallP instruction will return to the parent program (main pro-
gram) when the End instruction (equivalent to the Return instruction of GoSub) is reached. If there is no
End instruction, the execution is returned to the main program when the final step of the sub program is
reached.
(2) If arguments need to be passed to the sub program, they should be defined using the FPrm instruction
at the beginning of the sub program.
(3) If the type or the number of arguments passed to the sub program is different from those defined (by the
FPrm instruction) in the sub program, an error occurs at execution.
(4) If a program is reset, the control returns to the beginning of the top main program.
(5) Definition statements (Def Act, Def FN, Def Plt, and Dim instructions) executed in the main program are
invalid in a program called by the CallP instruction. They become valid when the control is returned to
the main program from the program called by the CallP instruction again.
(6) Speed and tool data are all valid in a sub program. Values of Accel and Spd are invalid. The mode of
Oadl is valid.
(7) Another sub program can be executed by calling CallP in a sub program. However, a main program or a
program that is currently being executed in another task slot cannot be called. In addition, own program
cannot be called, either.
(8) Eight levels (in a hierarchy) of sub programs can be executed by calling CallP in the first main program.
(9) Variable values may be passed from a main program to a sub program using arguments, however, it is
not possible to pass the processing result of a sub program to a main program by assigning it in an argu-
ment. To use the processing result of a sub program in a main program, pass the values using external
variables.
[Related instructions]
FPrm (FPRM)
4-159 Detailed explanation of command words

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents