Applies to:
ApexSQL Trigger
Summary:
This article describes the ApexSQL Trigger trigger template editor and its use
Description:
An important feature of ApexSQL Trigger, for advanced users, is its ability to customize trigger code patterns. ApexSQL Trigger provides a professional editor/IDE with syntax highlighting, auto-complete, line numbering, parsing and debugging features for this purpose
Trigger templates employ the exact same paradigm as Active Server Pages, the dynamic web authoring technology from Microsoft, as well as the same scripting languages - Microsoft VBScript and JScript. The script parser and debugger are the same for both ApexSQL Trigger templates and ASP
The template editor is accessed by clicking on the Edit template button, in the Home tab:
The template from the current auditing architecture profile will be loaded upon accessing the template editor
The template editor has three script panes:
Results - assuming the Trigger template processed without error, the resulting Trigger Script will be output to the Results pane.
This is the main working area of the editor. Through it new trigger templates can be created and existing templates can be edited
The template editor supports bookmarks
Quick tip: A bookmark is a way to easily navigate between points of interest in triggers template |
This pane also holds the template property page which is used to assign template attributes. It has five fields, and notable is the Includes which allows to select the include files
Support for Include files is a feature of ApexSQL Trigger templates. Include files, just like in HTML and ASP allow you to link a file to one or more libraries of code, usually functions, constants, and other. This way libraries can easily be re-used for multiple templates.
In the case of ApexSQL2053.audx - the default architecture included with ApexSQL Trigger installation - one include file is used the Utils2053.inc. This file contains several VBScript functions used for code formatting
To implement additional includes the following procedure is used:
Select the Includes row in the template property page, and click on the button in the right corner.
In the form that appears, you can add or remove include files. If the include files are not stored in the same directory as the template that calls it, check the Use a full file path option - this will hard code the full path to this file. Otherwise select Use a template path option:
A feature of the template editor is template parsing. It will look for mismatched script tags and help avoid potentially hard to debug errors. Currently, template parsing exists for missing script tags {% and %}.
There are three ways the parser can be run:
Click on the checked button in the toolbox
Go to the Run menu and click on the Parse option
If there is a missing script tag, the template parser will detect it and raise a warning to the user
In this example the closing tag is missing:
After parsing this message will be shown:
© ALL RIGHTS RESERVED. Termini di utilizzo Privacy Cookie Preference Center