##let [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation
VIRTUOSO CODE GENERATOR Reference Manual
#let
Assigns a value to a keyword.
Syntax
{value }
#let keyword= {expression}
Keywords
keyword is the keyword which is to be assigned a value. The
keyword must conform to the naming restrictions. See
Chapter 2 for keyword naming restrictions.
value is the value to be assigned to a keyword. This can be a
literal value or a keyword whose value is to be
assigned (i.e., #let keyword1= "!keyword2" or #let
keyword1=keyword2). If the literal value is a string,
the literal must be enclosed in quotes ("). If the
literal itself contains quotes, enclose it in single
quotes (') instead.
expression is the expression to be evaluated to assign a value to a
keyword. Any valid arithmetic expression can be used
(+,-,*,/). The precedence for these operators is the
same as for COBOL operations, i.e. (, /*, +-.
Description
The #let construct assigns a value or expression to a keyword. The
keyword that is assigned a value can be a new keyword (introduced for the
first time) or an existing keyword whose value is to be modified. Both
new and existing keywords can be assigned a value in the current scope.
If the keyword is new, its value is accessible from the current scope or
inner scopes. For example, a keyword introduced in a model is accessible
in a macro invoked by the model. Refer to the #returnvalue construct for
information on assigning a value to a keyword in a previous scope.
After you assign a value or expression to a keyword, the value can be
accessed by referencing the name of the keyword preceded by the
substitution character
Examples
EXAMPLE 1
#let element="product-no"
.
.
MOVE !element TO DB-KEY.
The above example illustrates the use of literal value assignment.
Notice that the literal is enclosed in quotes since it is a string. The
value assigned to the keyword is later accessed with the !element
reference.
EXAMPLE 2
#let image-password="!creator-pass"
This example illustrates the assignment of the value of one keyword to
another keyword. The value of the keyword creator-pass is assigned to
the keyword image-password. The following example performs the same
assignment:
#let image-password = creator-pass
EXAMPLE 3
#let A=5
#let B=6
#let C=A*B/2
This example shows a series of expressions assigned to keywords. In this
example, the keyword "C" will have a value of 15.
MPE/iX 5.0 Documentation