|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > SCS. - Select from Mutiple Cases > Multiple Choice Commands |
MiniRobotLanguage (MRL)
OGS. - Jump Command
Jump to a label based on the provided value using Gosub (GSB.).
Intention
This command can replace the often used "SCN. - Select Numeric Case" Command.
In this example we use it for the X_Buttonbar, replacing the original SCN. - Construct.
DOL.1
PIW.$$REA|$$MES
STR.Split String|$$MES|!|$$BNU|$$BME
JIV.$$BME=normal!|endloop
VBT.$$BME
SCS.$$BME
CAS.P!
GTO.weiter
CAS.R!
GTO.weiter
CAE.
GTO.endloop
ESL.
JIZ.$$JMP|endloop
:weiter
' Button-Number
VBT.$$BNU
VBT.$$BME
OGS.$$BNU|DoDictate|DoDictRh|DoRework|DoPosCom|DoNegCom|DoFunny|DoSchiller|DoGoethe|DoRoth|DoOldShure|DoBusch|DoRGPT4|ToEng|ToGer|ToSpan|Undo|DoPIA|DoPIB|WhatIs|DoCommand|DumpASC|Test|enz
:endloop
NEW.t
BRK.
EIF.
OOP.
:enz
END.
To replace a very long OGS. / OGT. - Line you can use a Variable instead:
VAR.$$JMP=But_Dictate|But_Dict_Rework|
$$JMP+But_Dict_Rhyme|But_Rework|But_Pos_Comment|
$$JMP+But_Neg_Comment|But_Funny_Comment|But_to_Schiller
$$JMP+|But_to_Goethe|But_to_Roth|But_to_SamHawkins|
$$JMP+But_to_Busch|But_to_Rhyme|But_Switch|SetLan|ToEng|ToGer|
$$JMP+ToSpan|Undo|DoPIA|DoPIB|WhatIs|DoCommand|DumpASC|Test|enz
OGS.$$BNU|$$JMP
Syntax
OGS.P1|P2[|P3]...
Parameter Explanation
P1 - (numeric) Variable/Value in the Range of 1 .. number of given Labels. This is the value that will select the Label to jump to.
P2 - (Label) Is a Variable or a Label that contains a Variable. This is the Label where the command will jump to when P1 is 1.
Can also be a Line-Number or a Formula in "(30+$$NUM)"
P3 ... P40 -(optional) More Labels like P2. You can specify as many as 40 Labels to Jump to.
Important: If the number in P1 evaluates to 1, it will be counted as "1".
If the number in P1 evaluates to a value larger then Pmax (Largest given Px) then the Command will Set the Timeout-Flag and continue with the next line.
You can check the Timeout-Flag using ITO. - If Timeout.
Example
'***********************************
' OGS.-Sample
'***********************************
$$NUM=2
' Will jump to the Label "DoDictRh"
OGS.$$BNU|DoDictate|DoDictRh
MBX. I am back!
ENR.
:DoDictRh
MBX.I am here!
RET.
Remarks
-
Limitations:
-
See also:
•