Multiple Choice Commands

<< Click to Display Table of Contents >>

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

Multiple Choice Commands

ESC. - End-Select-Case

Previous Top Next


MiniRobotLanguage (MRL)

 

ESC. Command

End Select Case

 

 

 

 

This command can be used together with:

    SCS.

    CAN.

    CAE.

    CAS.

to build  multiple-choice constructs.

 

ESC. (End Select Case) will close the multiple choice decision block.

 

See example below.

 

: §§TXT=Karl Kovse

SCS.§§TXT

CAS.Karl

 PRT.This will come

CAS.Peter

 PRT.This will not come  

CAE.

 PRT. This will not come

ESC.

MBX.Ready  

ENR.

 

 

 

 

 

Syntax

 

ESC.

 

 

Parameter Explanation

 

this command takes no parameters.

 

 

Speed in Ticks:

This command uses typically around 7 Ticks.

 

 

Example

 

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

' Demo for SCS., CAS., CAE., ESC. and CAN.

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

' SCS.-Test

'DBM.2

FOR.$$LOP|1|20

 VAR.$$TXT=Peter$$LOP

 VAR.$$NUM=500

 PRT.TXT=$$TXT

 SCS.$$TXT

 CAS.Was first case.

   PRT.First Case

' This one will come in the twentieth

 CAS.{Rufus&OR:Peter2}

   PRT.Was "Peter2..."

' You can jump out of the structure directly with GOTO.

' And you can nest unlimited many SCS.

   SCS.$$NUM

   CAN.(100*5)

     PRT.You can nest it unlimited.

   CAN. 499

' You can even intermix CAS. / CAN.

   CAS. Intermixed

   CAE.

     PRT.THis will not come

   ESC.

   JMP. otu

 CAS.Third

   PRT.Was Third

 CAS.{Peter&AND:3}

   PRT.Was "Peter" and "3"

' If you need a perfect match ...

 CAS.{&EXACT:Theo}

   PRT.This one is Theo.

 CAS.Fourth.

   PRT.Was this one.

' CASE ELSE

 CAE.

   PRT.Was nothing of all.

' END SELECT

 ESC.

 :otu

NEX.

MBX.Ending

:enz

END.

 

 

 

 

 

Remarks

 

Please do not write code between the SCS. and the first following CAS./CAN.

While the code will actually be executed, you could get memory-leaks if you jump out of the construct from that place.

 

 

 

Limitations:

-

There are no relevant nesting limitations.

Please always make formulas into () or they may not be calculated.

 

 

 

See also:

 

  1.6.1. Program Flow Control

  1. SCS. - Select Case

  2. CAS. - Case-String

  3. CAN. - Case-Numeric

  4. CAE. - Case-Else

   5.CFP. - Case Find Pattern

   6.ESL. - End Select Loop

   7.ESC. - End Select Case