Skip to main content

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.