macro <id>

macro <id>
Description

Defines a text fragment that can later be inserted by using the specified ID.

AttributesNameTypeDescription
idID 
ContextThe TJP File,
InheritableNoScenario Spec.No

The body is not optional. It must be enclosed in [ ]. Macros can be declared like this:


macro FOO [ This text ];

If later ${FOO} is found in the project file, it is expanded to ' This text '. Macros may have arguments. Arguments are special macros with numbers as names. The number specifies the index of the argument.


macro FOO [ This ${1} text ]

will expand to ' This stupid text ' if called as ${FOO "stupid"}. Macros may call other macros.

Macro IDs should have at least one uppercase letter as all lowercase letter IDs may be used in a later version for built-in macros like 'if', 'expr' or 'for'. Macro names can be prefixed by a questionmark. In this case the macro will expand to nothing if the macro is not defined. Otherwise the undefined macro would be flagged with an error message.


This macro call ${?foo} will expand to nothing if foo is undefined.