DO WHILE

From Recital Documentation Wiki
Revision as of 17:04, 10 November 2009 by Helengeorge (Talk | contribs)

Jump to: navigation, search

Purpose

Repeat a block of commands while a specified condition is true


Syntax

DO WHILE <condition>

[EXIT]

[LOOP]

ENDDO


See Also

DO, DO CASE, EXIT, FOR, IF, LOOP, SCAN


Description

The DO WHILE command repeats the commands between the DO WHILE and the ENDDO statement, until the specified <condition> becomes .F. The maximum number of nested DO WHILE loops allowed is 16.

If the specified <condition> result is .T., then all commands within the DO WHILE loop will be executed. If the specified condition returns an .F., the Recital/4GL will skip down to the first statement following the ENDDO to continue execution.

Note: Use of redefined macros in the body of the loop is not supported.

EXIT

If an EXIT statement is encountered then the DO WHILE loop is exited.

LOOP

If a LOOP statement is encountered, then control returns to the head of the DO WHILE loop.

ENDDO

The ENDDO statement terminates the DO WHILE loop. Commands within the DO WHILE must be properly nested.


Example

use patrons index events, names
seek "OPERA"
do while event = "OPERA"
    display name, event, seats*price off
    skip
enddo


Products

Recital Server, Recital