Creating and Editing Template Variables
On this page:
- Configuring variables used in a template
- Predefined functions to use in live template variables
After a template is expanded, its variables are presented in the editor as input fields. The values of these fields can be either filled in by the user or calculated by AppCode.
To have it done automatically, for each variable you need to specify the following:
- Expression to be calculated in association with the variable.
- Default value to be entered in the input field if the calculation fails.
The order in which AppCode will process input fields after the template expansion, is determined by the order of variables in the list.
Configuring variables used in a template
- Open the template settings, and in the Template Text area click the Edit Variables button.
The Edit Template Variables dialog box opens, where you can define how the variables will be processed when the template is used.
- In the Name text box, specify the variable name to be used in the template body.
- In the Expression drop-down list, specify the expression to be calculated by AppCode when the template is expanded. Do one of the following:
- Type a string constant in double quotes.
- Type a predefined function with possible arguments or select one from the drop-down list.
An argument of a function can be either a line constant or another predefined function. See the list of predefined functions below on this page.
- To enable AppCode to proceed with the next input field, if an input field associated with the current variable is already defined, select the Skip if defined check box.
- To arrange variables in the order you want AppCode to switch between associated input fields, use the Move Up and Move Down buttons.