[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DO WHILE

    DO WHILE is a structured programming command that allows command
    statements between it and its associated ENDDO to be repeated as long
    as the specified condition is True.

Syntax

    DO WHILE <condition>
       <commands>
       [EXIT]
       <commands>
       [LOOP]
       <commands>
    ENDDO

Options

    Exit: The EXIT statement unconditionally branches control from
    within a DO WHILE structure to the command immediately following the
    ENDDO.  This option is used generally when you want to terminate a DO
    WHILE structure based on an intermediate and not the DO WHILE
    condition.

    Loop: The LOOP statement branches control to the last executed DO
    WHILE command line.  Looping is generally used where you want to
    prevent execution of statements within a DO WHILE based on an
    intermediate condition and branch immediately back to the DO WHILE
    command line.

Usage

    ENDDO must terminate a DO WHILE structure.

    DO WHILE <condition> opens a structured procedure that processes
    subsequent commands only while the condition evaluates to True.

    If <condition> evaluates to a logical True, all subsequent commands are
    carried out until an ENDDO, LOOP, or EXIT is encountered.  ENDDO and
    LOOP return control to the DO WHILE command for another evaluation of
    <condition>.  EXIT passes control to the statement following the ENDDO.

    If the condition evaluates to a logical False, all commands between DO
    WHILE and ENDDO will be skipped and program control will go to the
    command following ENDDO.

    Macros: Macro variables can comprise all or part of the DO WHILE
    condition without limitation.

    Note that like all other control structures, only the first three
    characters of the END statement are significant.

See Also: FOR..NEXT IF LIST RETURN
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson