This macro iterates on the part of the input template specified as the first argument to the macro. The template specified inside the block is translated for each part of the input, with parts delimited by a separator pattern.
.foreach_part (input [,"separator-pattern" [,head [,tail]]]) simple-template .next[(separator)]
This macro creates a new scope wherein the local variable CurrentPart is defined to be the i-th part of the input template at iteration i. The Separator local variable contains the following separator.
This macro is particularly useful when you work with naming conventions.
For more information about naming conventions, see "Naming conventions" in the Models chapter of the Core Features Guide.
The following parameters are available:
Examples:
Convert a name into a class code (Java naming convention). In the following example, the variable %Name% is equal to Employee shareholder, and it is converted to EmployeeShareholder:
.foreach_part (%Name%, " _-'") %.FU:CurrentPart% .next
Convert a name into a class attribute code (Java naming convention). In the following example, the variable %Name% is equal to Employee shareholder, and it is converted to EmployeeShareholder:
.set_value(_First, true, new) .foreach_part(%Name%,"' _-'") .if (%_First%) %.L:CurrentPart% .set_value(_First, false, update) .else %.FU:CurrentPart% .endif .next