All docs
V20.2
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ForEach

«ForEach(iteration_bounds,main_template,[prefix_template],[between_template],[postfix_template])»

Position Parameter Description
1 Iteration bounds The string composed by the following template "[visibility] member in scope" (see Iterating Through Elements)
2 Main Template The template to expand for each element
3 Prefix Template (optional) The template to expand before elements
4 Between Template (optional) The template to expand between elements
5 Postfix Template (optional) The template to expand after elements

Iterates through language elements in the active or specified scope (Me, this, base, inherited, method, property, ClipType, ClipClass, File, or block). It calls the specified template once for each item found.

Elements that can be iterated include Field, Parameter, Property, Member, Method, Event, Class, etc. Members can be preceded by a visibility filter (e.g., "public", "private", etc.). Inside the template you're calling, use «?Get(itemName)» and «?Get(itemType)» to get the name and type of each item iterated.

The Text Command use is detailed in the Iterating Through Elements article.