When creating a new method, wouldn't it be great if header information such as method name and author could be automatically entered? In 4D v11 SQL, this is now possible with the attribute method_event for the "macro" element.
Below is an example macro to create a header:
<macro name="Header2" method_event="on_create" version="2"> |
The important thing to take note of the is version attribute is set t "2". In addition, a method needs to be called.
Here is the code for the AddHeader method:
C_TEXT($test) |
An important thing to take note of from this code is the "Full method text" constant for the SET MACRO PARAMETER command. This is the parameter that needs to be passed in order to write the text to the method.
That's it. Now everytime a method is created, the header information will be automatically entered.