Multiple Choice Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > SCS. - Select from Mutiple Cases >

Multiple Choice Commands

OGT. - On x Goto

Previous Top Next


MiniRobotLanguage (MRL)

 

OGT. - On X Goto

Jump to a label based on the provided value using Goto (GTO.).

 

 

Intention

 

This command can replace the often used "SCN. - Select Numeric Case" Command.

It will jump to any of the given - up to 40 - Labels depending on the Value in P1.

 

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

 

 

OGT.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 a value larger then Pmax (Largest given Px) then the Command will not run into error but just continue with the next line, setting the Timeout-Flag..

                  This can be utilized for sort of "CASE ELSE".

 

 

Example

 

'***********************************

' OGT.-Sample

'***********************************

$$NUM=2

' Will jump to the Label "DoDictRh"

OGT.$$BNU|DoDictate|DoDictRh

MBX.Value was too large!

ENR.

 

:DoDictRh

 MBX.I am here for DicRhyme!

ENR.

 

:DoDictate

 MBX.I am here for Dictate!

ENR.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: