Do

From BR Wiki
Revision as of 02:32, 6 February 2013 by Laura (talk | contribs)
Jump to navigation Jump to search

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

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.