Home Online Manual
Top
Back: Evaluation of logical expressions
Forward: Usage of commas
FastBack: System dependent limitations
FastForward: Miscellaneous oddities
Up: Major differences to the C programming language
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

6.3.3 No case or switch statement

SINGULAR does not offer a case (or switch) statement. However, it can be imitated in the following way:

 
while (1)
{
   if (choice == choice_1) { ...; break;}
   ...
   if (choice == choice_n) { ...; break;}
   // default case
   ...; break;
}