Select : EndSelect

Syntax

Select <expression1>
  Case <expression2> 
     ...
  [Case <expression3>]
     ...
  [Default] 
     ...
EndSelect 

Description

Select allows a quick choice. The programme will execute the <expression1> and keep its value in memory. It will compare this value to all of the "Case <expression> values" and if true it will execute the corresponding code and quit the Select structure. If none of the Case values are true, then the Default code, (if specified), will be executed.

Example :

  a = 2
  Select a
    Case 1
      PrintN("Case a = 1")
    Case 2 
      PrintN("Case a = 2") 
    Case 20 
      PrintN("Case a = 20")
    Default
      PrintN("I don't know")
  EndSelect

Syntax

FakeEndSelect

Description

When you want to jump from a select part (with the command Goto) to another part in the code outside of the Select, you need to use a FakeEndSelect which simulate an EndSelect without do it really. If you don't use it, your program will crash.

Example :

  Main_Loop:
    ... 
    Select a
      Case 10
        ...
      Case 20
        FakeEndSelect
        Goto Main_Loop 
    EndSelect