Template Tips #2

We found that some 3rd party templates that use #EXPORT or some other output are generating text in the middle of the generation of the APP itself. This can be very dangerous as it can “break” the code generation for the current module, leaving the user of that template with a partially generated file, or no file generated at all.

We also found some templates are sometimes using the wrong embeds to call its functionality, and that can create a problem when the template fails for any error.

The side efect of both of these template coding errors are code generation errors in the application generated source. So for templates developers we strongly encourage you to check the embeds you use and the location to ensure you are not generating code that can fail in the middle of the application generation process.

One of the changes needed by some 3rd party templates is the use of the embed:
#AT(%ProgramEnd)

this MUST be changed to:
#AT(%AfterGeneratedApplication)

The %AfterGeneratedApplication embed should be used for any side processing and code generation that is not related to the
main code generation of the APP.

We recommend that if you have a 3rd party tool that does some extra processing with the APP to take a look at the code yourself or send a query to the developer of that tool and ask them to ensure their template is not doing any processing in the wrong embed (#AT(%ProgramEnd).

2 thoughts on “Template Tips #2

  1. Thanks for the information. So what would be a valid template usage of #AT(%ProgramEnd) if any at all?

    1. The embed %ProgramEnd is declared in a group called #GROUP(%KillCode) and there all the code to uninitialize the classes or anything that need to be done before the program ends.
      That embed is supposed to be used to write code to the PROGRAM module.

Comments are closed.