This macro iterates through and transforms the parts of the input template, with the parts delimited by a separator pattern.
.foreach_part (expression [,"separator" [,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 often used in applying naming conventions (see Core Features Guide > The PowerDesigner Interface > Objects > Object Properties > Naming Conventions).
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