<< Click to Display Table of Contents >> Navigation: 3. Script Language > JXX. - Jump - Instructions > JXX-Commands: "Jump If ..." |
MiniRobotLanguage (MRL)
ENR. Command
Ends a script and Return to a calling script if there was one.
Intention
Mix between END. and RTS. Will execute an RTS. if possible, if not en END. will be executed.
End script execution and return to a calling script. Or if P1 > 1 then return to the calling-script of the calling script of the ... (and so on).
Imagine you experience an error in a deeply nested subscript. Therefore you want to jump to a global error-handler in the Main script. Then you use the ENR.(num) option, to immediately jump up to the highest level.
Syntax
ENR.[P1]
Parameter Explanation
P1 - (optional) NUM , default 1. Count how many levels the "Return" should jump up.
Example
' Simply ends a Script or returns to a calling script.
ENR.
' Ends a Script and jumps TWO JNF.-Levels up.
ENR.2
Remarks
To end a script and set a Return-code, use END.
To set a Return code without ending the script, use SEC. (Set Exit Code).
If you try to Jump up to many JNF-Levels then the script will just end without an Error-Message. This is wanted behavior.
Limitations:
-
See also:
• RTS. - ReTurn from Subroutine
• JNJ. - JumpNewFile-Jump to Label