The EASI WHILE command provides a general purpose looping construct.
WHILE (log_expr) statement list ENDWHILE
where
[log-expr] ..... is a logical expression which is evaluated before
each iteration of the loop.
[statement list] is the list of command statements to execute
while the conditions for the loop hold true
The statements in the body of the WHILE loop are executed as long as the logical expression in the WHILE statement evaluates to TRUE. That is, when execution reaches a WHILE statement, the logical expression is evaluated, and if TRUE, the body of the loop is executed. When execution reaches the ENDWHILE statement, it jumps (or loops) back to when WHILE statement at which point the logical expression is evaluated again. When the logical expression becomes FALSE, execution transfers to the statement following the ENDWHILE, otherwise the looping continues.
For example, consider the following program:
local double NumberA
input "Enter a number between 1 and 25: " NumberA
WHILE (NumberA < 0 or NumberA > 25)
print "This number is not within the required range!"
input "Please enter a number between 1 and 25: " NumberA
ENDWHILE
print "Thank You!"
This WHILE loop makes sure that only a number that falls within a specified range (from 1 to 25) is entered. The user will keep being asked to enter numbers until the number entered satisfies the condition. Once this happens, the PRINT command that follows the ENDWHILE command will be executed.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.