Click or drag to resize

BREAK Statement

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
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.

Syntax

Alchemy
BREAK;

Example

The following code snippet terminates the FOREACH-IN loop after map2 has been processed. That is, map3 and map4 will not be processed.

Alchemy
$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