Programming Guide |
Stops loop execution
break [intConstant
]
intConstant
- The number of nested loops to stop, where a value of
1
specifies the current loop. If you omit this argument,break
exits the current loop.
The
break
command stops execution of the current while or for loop. If the current loop is nested inside one or more other loops, andintConstant
is greater than1
,break
stops execution of the specified number of outer loops. IfintConstant
is greater than or equal to the number of loops currently being executed, JPL stops each loop until it exits the outermost one.
// Concatenate address and execute function for 100 entries.
// If cities[i] is empty stop executing the loop.
//vars i, address, total
for i = 1 while i <= 100
{
if cities[i] == ""
break
address = cities[i]##", "##states[i]##" "##zips[i]
call do_process (address)
}
total = i - 1
msg emsg "Done! :total addresses processed."