![]() | ![]() | 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,
breakexits the current loop.
The
breakcommand stops execution of the current while or for loop. If the cur rent loop is nested inside one or more other loops, andintConstantis greater than 1,breakstops execution of the specified number of outer loops. IfintConstantis 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."