Adding Parameters to Substitution Variables

Parameters can be added to substitution variables to further enhance or manipulate the values that are substituted in the text.

Parameters are added in the same way as when inserting substitution variables within text, in that a pipe character ‘|’ (without quotes) is added to the end of the variable. Further parameters, each separated by ‘|’, finishing with ‘|;’ can then be added when the full substitution variable with the required parameters has been entered. This combination tells the program when to start and end processing of the substitution variable with parameters.

Examples

In the following examples, the substitution variable ‘&UN’ is used to return the text of ‘Administrator’.

EXAMPLE: If the basic form of the substitution variable was used:

 

‘User &UN has logged on’ would return:

 

‘User Administrator has logged on’

However, by using parameters the user name can be displayed in upper case. To do this, add the ‘u’ parameter. (a full list of parameters can be found in Substitution Variable Parameters). This would affect the previous example as follows:

EXAMPLE: ‘User &UN|u|; has logged on’ returning:

 

‘User ADMINISTRATOR has logged on’

To add multiple parameters and change the appearance of the substitution variable even further, specify, for example:

EXAMPLE: ‘User &UN|u|+5|; has logged on’.

 

This substitution variable entry would now return:

 

‘User ADMIN has logged on’

This is because the variable now has the parameters of firstly converting the user name to upper case and then returning just the first five characters of the user name.

NOTE: Substitution variables can return either string or numeric values. While applying each parameter, the software checks to see if the variable result is numeric. If it is, then only numeric parameters can be applied from that point onwards. To override this behavior and treat the numeric result as a string, the ‘s’ parameter can be used.

Related Topics