Using Substitution Variable Syntax

For any Dimensions CM or user-defined variables, you can use substitution variable syntax for greater control over formatting. This syntax organizes the attributes into precise columns as an alternative to using manual spacing or tabs in a template as formatting.

The syntax is:

%<variable-name>:<c>:<w>:<s>%

where:

Option | Description
<c> | Is an integer specifying where the column starts from the left of the template, in characters.
<w> | Is an integer specifying the column width in characters. Specify a positive number to add padding to the right of the field, which ensures that if data doesn't fill the field, the text written to the right of the field will always start at the next column position. To eliminate padding, specify the column width as a negative number. Text following this field will then appear in the next column following the last character of data.
<s> | Is a single character (upper or lower case) that specifies the column alignment. The available characters are: L: Left-justified. Data will be aligned with the left-hand edge of the column. Excess data will be truncated at the column boundary. R: Right-justified. Data will be aligned with the right-hand edge of the column. Excess data will be truncated at the right-hand column boundary. C: Centered. Data will centered within the column. Excess data will be truncated at the right-hand column boundary. W: Wrapped. Data will be aligned with the left-hand edge of the column. Excess data will be wrapped onto successive lines.

For example:

| %CUSTOMERS_BLOCKNAME% ---------------------
%CUSTOMER_PROMPT:9:16:L% ------------------------ | %PHONE_PROMPT:27:7:L% --------------------- | %PRIORITY_PROMPT:40:7:L% ------------------------
%CUSTOMER:9:16:L% | %PHONE:27:7:R% | %PRIORITY:40:7:C%

Rules and recommendations

- You must include either all of the fields in the substitution variable syntax (c:w:s) or none of them.

- Generally, make the starting column equal to or greater than the previous column's starting column value plus its width. This ensures that the columns of data are separated by whitespace.

- We do not recommend using substitution variable syntax (%<variable-name>:<c>:<w>:<s>%) and plain substitution variables (%<variable-name>%) on the same line. This can lead to unpredictable formatting results.

- You can use a mixture of both variable types on different lines without any problem.

- Substitution variable syntax is supported only for plain text substitution.

- Substitution variable syntax is not supported for proportional fonts because positions are determined by the number of characters you specify.

- Avoid using tab characters or inserting text to the left or right of substitution variable syntax. These actions may lead to unpredictable formatting results.

Related Topics

Single-Valued Dimensions CM Variables

Multi-Valued Dimensions CM Variables

User-Defined Variables