...
This page has advanced features that require a knowledge of JavaScript.
Details
In expressions (created by using Expression dialog or using <%= %> syntax in the template) the following short-hand is allowed to reference variable values:
...
<%= #code1 + #code2 %> - if the values are numeric, will result in the two numbers being added together, otherwise the two values will be concatenated together.
In expressions, script, or script blocks
...
- The variable's value, or
- Blank if the value is null or defined as a missing value
...
#code.value.toString() displays:
- the variable's value (even if the value is defined as missing) or
- blank if the value is null.
...
#code.displayValue.value displays:
- Numeric variables: returns a number
- Date variables: returns a date
- All other variables: returns a string representation of the value
- Missing values or null: returns null
...
#code.value.value displays:
- Numeric variables: returns a number
- Date variables: returns a date
- All other variables: returns a string representation of the value
- Missing values: returns the missing value
- Null: returns null
...
#code.value.value - if the value is for a numeric variable, the result is a number; if the value is for a date variable, the result is a date; otherwise the result is a string representation of the value. If the value is null, the result is null. Note, values defined as missing are returned (i.e., they are not returned as null).
#code#code.displayValue.name - returns the picklist display name associated with the variable's value. If the value is null or defined as a missing value, empty string is returned.#
code#code.value.name - returns the picklist display name associated with the variable's value even if the value is defined as missing. If the value is null, empty string is returned.
Detailed explanation
...
#code - refers to an object with the following properties: variableId, definition, displayValue, value.
...
d) toString(): returns a string representation of the value or empty string.
Examples
Output a variable value:
<% Output.Write( #code.displayValue.toString() );
Output a variable value even if it is defined as missing:
<% Output.Write( #code.value.toString() );
Output a sum of two numeric variables:
...