The CALSUB Command [MLEPC]
The CALSUB command is used to activate a predefined subprogram.
The subprogram ID[1] can be identified by either a whole number value a, or by a quoted subprogram name.
Various subprogram types are supported. If a subprogram type is specified with the CALSUB command, then it must match the type defined on the corresponding DEFSUB command.
CNC specifies a subprogram defined in a separate program element than the caller. The post-processor will output a subprogram containing the code generated from the DEFSUB-ENSUB block either immediately, or when called, or at the end of processing, depending on how the post-processor is configured. For each call, the post-processor will update the processing status based on the subprogram contents, and then will generate a call instruction to the subprogram.
RANGE specifies a subprogram defined as repeat range in the same program element as the caller. The post-processor will process the DEFSUB-ENDSUB contents at the first call, bounded by labels or sequence numbers. For each subsequent call, the post-processor will update the processing status based on the subprogram contents, and then will generate a call instruction to repeat the bounded code.
INCLUD specifies an emulated subprogram. The post-processor will save the contents of the subprogram when defined, and then post-process the saved CLDATA contents at each call.
CLDATA specifies to use preferably a CNC subprogram if supported, but if not then a RANGE repeat if supported, otherwise to emulate the subprogram (i.e., INCLUD).
SYSTEM specifies a controller resident subprogram. For each call, the post-processor will update the processing status based on the subprogram contents if a subprogram was defined, and then generate a call instruction to the controller resident subprogram. A SYSTEM subprogram does not have to be defined.
The couplet (keyword,
The couplet (keyword,
A subprogram can call another subprogram, to a maximum nesting depth of 16 if emulated, and to a QUEST defined limit if supported by the machine.