|
ION Script User's Guide: ION Script Tag Reference |
|
The ION_EVALUATE tag evaluates expressions inside an ION Script document. It can simply evaluate an expression or output the result of the expression into the resulting document.
<ION_EVALUATE
EXPR="expression"
[DISPLAY={"TRUE" | "FALSE"}]
[FORMAT="format string"] />
The expression to be evaluated by the parser. This attribute can contain a variable. See Variables, Expressions & Operators for details on writing ION Script expressions.
Note that the way you declare a variable is different from the way you use ION_EVALUATE to assign a value to a variable. When declaring a variable with VARIABLE_DECL, you do not prefix the variable name with the $ symbol. When you assign a variable a value using ION_EVALUATE, you do prefix the variable name with the $ symbol, regardless of whether or not the variable has already been declared. For example:
<ION_EVALUATE EXPR="$Temperature = 98.6"/>
| Warning Assigning $Browser.REMOTE_USER as a string variable to the VALUE attribute can be dangerous because it is frequently an undefined system variable. When VALUE is undefined, IDL reports an error. However, it is possible that code that uses $Browser.REMOTE_USER could be implemented and tested without error on one system and fail if ported to another system. |
Determines whether or not to display the result of the expression in the outputted HTML page. The default value is FALSE.
Specifies the C-style printf() formatting string. The syntax for the FORMAT attribute is as follows:
FORMAT="%[flags][width][.precision][type length] specifier"
where
flags is one or more of the following characters:
width is an integer specifying the minimum field width. If the result has fewer characters than the field width, it is padded on the left (or right, if the - flag has been specified). The padding is done with spaces unless the first character of width is a zero, in which case the padding is done with zeros.
precision is an integer preceded by a decimal point specifying the minimum number of digits to appear for the d, o, or x format specifiers, or the maximum number of characters to be printed for the s format specifier. It is also the precise number of digits to display after the decimal (including trailing zeros) for the e, E, f, g, or G specifiers.
type length is one of the following:
specifier is one of the following:
|
ION Variable Type
|
Valid Specifiers
|
|---|---|
|
BOOL, STRING
|
%s
|
|
INT
|
%d, %i, %o, %u, %x, %X
|
|
DOUBLE
|
%e, %E, %f, %g, %G
|
| Note For more information on using format specifiers, refer to a C programming manual. |
The ION_EVALUATE tag inserts the result of EXPR directly into the HTML stream if DISPLAY="TRUE". If DISPLAY="FALSE", no HTML output is produced.
IDL Online Help (March 06, 2007)