Click or drag to resize

FOREACH-IN Statement

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
FOREACH-IN Statement

FOREACH statements are similar to WHILE statements, but have stricter conditions. Given a list of data, they perform the code in their execution block once for each member of that list.

Syntax

Alchemy
FOREACH $var IN list_A
do_A

Nomenclature

$var A variable that is assigned, in turn, to each of the values in list_A.
list_A An array, a C# ArrayList, or a C# Hashtable.
do_AThe code block that executes once for each value of $var.

Example

Alchemy
FOREACH $file IN file_list
BEGIN
  IMPORT streets [...]
  FROM "C:\Path_To_Data\" + $file;
  COMMIT;
END