Embed Points

Top  Previous  Next

One of the most important template language statements is #EMBED, which defines an embed point. These extend the structure and functionality of the procedure template by allowing the programmer to add their own custom code. The embed points indicate "targets" at which the developer can add their own custom code to the generated source. These are also the "targets" for the source code generated by control and extension templates.

Each procedure template allows for a certain number of default points at which embeds are allowed. These are typically points which coincide with messages (events) from the operating environment (Windows), such as when the end user moves focus from or to a field. The template programmer can add to, or subtract from, the list.

When the developer customizes the template, pressing the Embeds button in the Procedure Properties dialog provides access to all the embed points available in a procedure. The Actions popup menu selection in the Window Formatter also provides access to the embed points for a specific control.

The developer adds custom code; either hand coded from scratch in the editor, or created with a code template at the embed point. The embed points are also the points into which control templates and extension templates generate executable code to support their functionality.

The Application Generator stores the embed point's code (no matter what its origination) in the .APP file. At code generation time, the Application Generator processes the template, producing source; when it reaches an embed point, it places the developer's code, line by line, into the generated source code document.