REPEAT

Repeatedly execute a statement

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
REPEAT statement

Arguments

statement

A single or compound statement to be repeatedly executed.

Discussion

The REPEAT statement repeatedly executes a statement until a condition ­occurs to transfer control to another statement. This statement is functionally equivalent to the DO FOREVER statement.

Statement can be on the next logical line. It is executed repeatedly until control is explicitly transferred to a label outside of the scope of statement, or until an EXITLOOP is executed.

See also

DO FOREVER statement

Examples

.define TTCHN           ,1
record
    password            ,a5
external function
    chkpass             ,d
proc
    open(TTCHN, o, "tt:")
    xcall flags(50000, 1)
    repeat
      begin
        display(TTCHN, "Enter password: ")
        reads(TTCHN, password, exit)
        if (%chkpass(password))
          exitloop
        writes(TTCHN, "Invalid Password")
        sleep 1
      end
    display(TTCHN, $scr_clr(screen), "XYZ Accounting System")
    xcall process               ;User is valid - now do something
exit,
    stop
end