Organization
A template file is organized into blocks and when outputting a database, HyperWorks Desktop processes a template on a per-block basis. Blocks are output in the order that they are defined in the template file.
You define the beginning of a block with a scan command (*card, *component, *elements, and so on) and then close the block with the *output() command.
- before() - At this level, you can define a series of commands that HyperWorks Desktop processes before moving to the next level. The before() level is executed once for each data type requested. Use this level to add comments and set up parameters on the following levels. Some of the data in the database is available at this level.
- beforecollector() - At this level, HyperWorks Desktop scans the database for the requested data type. Each time HyperWorks Desktop finds the requested data type collector, it executes the beforecollector() level. Use this level to add comments about the data and create groups. Collector data is available at this level.
- format() - At this level, HyperWorks Desktop processes the commands defined for each entity contained in a collector. The data associated with the printed entity is available, and the format required for each entity is defined at this level.
- aftercollector() - After the data entities within a collector have been processed, HyperWorks Desktop goes to the aftercollector() level. The aftercollector() level is processed after each collector is scanned. Only the collector data is available at this level.
- after() - The after() level is similar to the before() level. HyperWorks Desktop executes the after() level once after HyperWorks Desktop scans the database.
The before() and after() blocks are executed even if none of the entities specified exist in the database. Database information (except for global data) is only available on levels two through four.