Top
Back: 6.2.5 Usage of brackets
Forward: 6.2.7 Return type of procedures
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.6 Behavior of continue

SINGULAR’s continue construct is only valid inside the body of a for or while construct. It skips the rest of the loop-body and jumps to the beginning of the block. Unlike the C-construct SINGULAR’s continue does not execute the increment statement. For example,

 
for (int i = 1 ; i<=10; i=i+1)
{
   …
   if (i==3) { i=8;continue; }
     // skip the rest if i is 3 and
     // continue with the next i: 8
   i;
}
→ 1
→ 2
→ 8
→ 9
→ 10

Top Back: 6.2.5 Usage of brackets Forward: 6.2.7 Return type of procedures 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.