Do: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
See also [[DO LOOP]] and [[Exit Do]]. | |||
The DO/LOOP structure, which can be used to replace [[GOTO]] statements for more structured programming. Notably, labels or line numbers are not required to exit the loop. The DO and LOOP statements must always be used in conjunction with one another to specify the beginning and ending of the loop. The Exit DO statement may be used to break out of the loop. | |||
===Syntax=== | |||
[[Image:Do.png]] | |||
===Defaults=== | |||
1.) When no WHILE or UNTIL condition is specified, execute. | |||
2.) The loop until the LOOP statement's conditions or an Exit DO indicate otherwise. | |||
===Parameters=== | |||
The WHILE keyword indicates that the loop should be executed only if the specified conditional expression evaluates to true. If the conditional expression evaluates to false, execution will skip to the first line following the LOOP statement. | |||
The UNTIL keyword indicates that the loop should be executed only if the specified conditional expression evaluates to false. If the conditional expression evaluates to true, execution will skip to the first line following the LOOP statement. | |||
The word DO on the DO statement is optional when WHILE or UNTIL is specified. Business Rules will insert the word DO. CONFIG STYLE INDENT will cause lines between the DO and LOOP statements to be indented. | |||
<noinclude> | |||
[[Category:Statements]] | |||
[[Category:Loop Statements]] | |||
</noinclude> |
Revision as of 02:32, 6 February 2013
The DO/LOOP structure, which can be used to replace GOTO statements for more structured programming. Notably, labels or line numbers are not required to exit the loop. The DO and LOOP statements must always be used in conjunction with one another to specify the beginning and ending of the loop. The Exit DO statement may be used to break out of the loop.
Syntax
Defaults
1.) When no WHILE or UNTIL condition is specified, execute. 2.) The loop until the LOOP statement's conditions or an Exit DO indicate otherwise.
Parameters
The WHILE keyword indicates that the loop should be executed only if the specified conditional expression evaluates to true. If the conditional expression evaluates to false, execution will skip to the first line following the LOOP statement.
The UNTIL keyword indicates that the loop should be executed only if the specified conditional expression evaluates to false. If the conditional expression evaluates to true, execution will skip to the first line following the LOOP statement.
The word DO on the DO statement is optional when WHILE or UNTIL is specified. Business Rules will insert the word DO. CONFIG STYLE INDENT will cause lines between the DO and LOOP statements to be indented.