Since the macros that are created for us along with the new macros that will be created are saved in an XML file, it is a good idea to take a look at the XML format of a macro. 4D macros are built using customized XML tags called "elements". Each start tag of an element must have an ending tag. A start tag is represented by <tag>, an ending tag looks like </tag>, however <tag/> is both a start and end tag.
The basic requirement of a macro is defined in the sample macro below:
An example macro using the basis requirements:
<text> For($i;1;Records in selection(<Caret/>))
Here are the descriptions of the 4D Macro tags.
Initializes and ends a macro file. This tag is required in a macro file.
Defines a single macro and its attributes.
This tag is replaced by the selected text when the macro is inserted. If no text is
selected, then the tag is empty.
This tag will encapsulate what you want the macro to place in your method.
The contents can be either comments, or 4D commands.
After the macro has been inserted, the cursor returns to this position.
The current 4D user is returned in this position
The current system user name is returned in this position.
The current method name is returned in this position
The current time is returned in this position.
The contents of the clipboard is returned in this position