Top
Back: 6.2.2 Evaluation of logical expressions
Forward: 6.2.4 Usage of commas
FastBack: 6. Tricks and pitfalls
FastForward: A. Examples
Up: 6.2 Major differences to the C programming language
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

6.2.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: 6.2.2 Evaluation of logical expressions Forward: 6.2.4 Usage of commas FastBack: 6. Tricks and pitfalls FastForward: A. Examples Up: 6.2 Major differences to the C programming language Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.