REPEAT - UNTIL
REPEAT - UNTIL statements can only be used in internal functions or procedures. REPEAT - UNTIL statements provide logical operations in the same manner as in IF - THEN - ELSE and CASE statements, but they are often somewhat more convenient, especially for looping operations. The REPEAT - UNTIL statements are written in the same manner as in other high-level programming languages. Note the REPEAT - UNTIL construct cannot be used in the main program or in Modules and Subprograms. Here is a small function which uses REPEAT - UNTIL.
FUNCTION SUMINV(X)
SUMX:=0; i:=0
REPEAT
i:=i+1
SUMX:= SUMX+1/X^i
UNTIL (i>10)
SUMINV:=SUMX
END
Note that EES internally changes Duplicate loops into Repeat-Until blocks during compilation in internal functions and procedures