|
SYNOPSIS
<$var = [value1 ...] >
<$var = (SQL expression)>
DESCRIPTION Variables are explicitly set with an assignment statement. The
variable on the left is set to the list of values on the right. The
right-side values are either literals (plain strings) or other
variables. Each value of a variable on the right is assigned to a
single value of the left-side variable; values are not concatenated
together. If no values are given on the right, the assigned-to (left)
variable is unset (i.e. has no values). Example:
<$code = Klaatu veratis niktoe>
<$said = Goort $code right now>
The value of $said would be the 6 values Goort,
Klaatu, veratis, niktoe, right, now.
If the right side is enclosed in parentheses, then it is
interpreted as an expression and evaluated. It may then be any valid
Texis select expression:
<$x = (19 * 6 + 5)>
<$txt = ( "This is test " + $x )>
The value of $x would be the integer 119, and the value
of $txt would be the string "This is test 119": the
+ operator concatenates when given strings.
If the assigned-to variable is currently in a loop construct,
e.g. inside a LOOP, SQL or TIMPORT that is looping
over the variable, then only the current value of the variable
is changed, to the first value of the right side . The type is cast to the overall type of the
assigned-to variable. If no values are present on the right, then the
assigned value is the empty string ("").
CAVEATS Note that the assigned-to variable's type may change if the overall
type of the right side is different. For example, integer values
may become strings if non-numeric strings are on the right side.
If an expression (in parentheses) is being used,
multi-value variables are converted according to the current
<sqlcp arrayconvert> setting,
and an empty (no values) variable is considered an empty string.
SEE ALSO
SQL, EXPORT
Copyright © Thunderstone Software Last updated: Mon Feb 18 10:28:15 EST 2013
|