BREAK Statement |
The BREAK statement skips the remainder of the loop body and terminates the current loop. The BREAK statement is commonly used to terminate a WHILE or FOREACH-IN loop.
BREAK;
The following code snippet terminates the FOREACH-IN loop after map2 has been processed. That is, map3 and map4 will not be processed.
$file_list = array.new("map1", "map2", "map3", "map4"); FOREACH $file IN file_list BEGIN IF $file = "map3" BREAK; IMPORT streets [...] FROM "C:\Path\" + $file; COMMIT; END