GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Four — Flow Control (continued)
The ‘while’ loop is defined by the while keyword. The code is executed repeatedly until the boolean condition becomes false. ‘While’ loops differ from ‘do’ loops in that the condition is tested before the loop executes.
The while statement uses the following formal syntax:
while (expression)
statement(s)
The following example illustrates a while loop:
int i;
i = 0;
while (i < 10) {
MessageBox("This is the number %d", i);
i++;
}
Note that in ‘while’ and ‘do’ loops the counting variable is not incremented automatically as part of the loop structure. It is the programmer’s responsibility to create looping structures and conditional expressions that result in a finite loop. Infinite loops may cause the application to behave unexpectedly or even hang so they must be used with care. The break and continue keywords can be used to control loop execution. In addition, the return or exit statements can end loop iteration.
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.