Maptitude GISDK Help

While Statements

 

You use a while statement to create loops based on a condition:

 

while expression do

     <statements go here>

     end

 

The contents of the while loop are executed until the Boolean expression is false. If the Boolean expression is false when the while loop is first encountered, its contents are not executed.

 

while value < 1000 do

     value = RunMacro("Get next value")

     end

 

You can use a break statement to exit the smallest enclosing loop. For example:

 

i = 1

while i le 10 do

     ShowMessage("i="+String(i))

     if i = 5 then break // only the first five messages will be displayed

     i = i + 1

     end

 

You can use a continue statement to go to the next iteration of  the smallest enclosing loop. For example:

 

i = 1

while i le 10 do

     if i > 5 then continue // the last five messages will not be displayed

     ShowMessage("i="+String(i))

     i = i + 1

     end

 

 

©2025 Caliper Corporation www.caliper.com