Macros can be used to express template logic, and to loop on object collections. Each macro keyword must be preceded by a . (dot) character and has to be the first non blank character of a line. Make sure you also respect the macro syntax in terms of line breaks.
You define a macro inside a template, or a command entry.
There are three types of macros:
.macro-name [(parameters)] block-input .endmacro-name [(tail)]
.foreach_macro-name [(parameters[,head[,tail]])] complex-template .next[(separator)]
The following macros are available:
Conditional and loop / iterative macros:
.foreach_item macro – iterates on object collections
.foreach_line macro – iterates on lines
.foreach_part macro – iterates on parts
.break macro – breaks the loop
Assignment macros - define a local variable of object or value type as well as volatile attributes:
Output and error reporting macros:
Command macros - only available in the context of the execution of a generic command:
.vbscript macro - embed VB script code inside a template
.execute_vbscript macro - launch vbscripts
.execute_command macro - launch executables
.abort_command macro - stop command execution
.change_dir macro - changing a directory
.create_path macro - creating a specified path
Formatting macros:
.convert_code and .convert_code macros – converts codes into names
String manipulation macros:
.block macro - adds a header and a footer to a text block
Miscellaneous macros:
.comment and .// macro - inserts a comment in a template
.collection macro - returns a collection of objects based on the specified scope and condition
.object macro - returns an object based on the specified scope and condition
.bool macro - evaluates a condition
.set_interactive_mode macro – defines whether the GTL execution must interact with the user