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;
}


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
            User manual for Singular version 4.4.0, 2024, generated by texi2html.