Exploring Loops
Starset has an elaborated system of loop statements, including simple, sequential, and parallel loops.
Simple Loop
A simple loop is a familiar WHILE loop that executes its body—a compound DO-END statement—as long as the loop condition is true. Consider a code fragment that implements a procedure for calculating the first count prime numbers. This example illustrates not only simple loops but also other important concepts:
-
The procedure is defined with the keywords PROC and ENDPROC. If it’s the first procedure in the program, it’ll be considered the main procedure and executed (see the example).
-
The procedure begins with variable declarations. You must declare every variable in a subroutine according to its type, which might ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access