REPEAT

Repeatedly execute a statement

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
REPEAT statement

statement

A single or compound statement to be repeatedly executed.

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.

DO FOREVER statement

.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