Using VPLUS: An Introduction to Forms Design (32209-90004)

5-8
field,
or a constant value, or a calculated value to a
destination
field. If
the
destination
or
source
is not specified, the value of the current
field,
currentfield
, is assumed. The
destination
is always a field,
either a specified field name, the current field, or a save field name.
The
source
can be a field, a constant, an expression, or an index
retrieve operand. Note that, unlike the edit statements, the various
SET
statements cannot have a custom error message.
Constants in SET statements are specified just like constants in edit
statements; that is, a character constant is surrounded by quotes
("JONES"), a date constant by exclamation points (!February 20, 1986!),
and a numeric constant has no delimiters (12.35). In every case, the
constant must be the same data type as the field to which it is being
moved.
Expressions are always numeric. Expressions allow you to calculate
values based on the value of numeric fields and/or constants.
Expressions are very useful to calculate values and assign the result to
a display-only field.
Index retrieve operands consist of an index and a list of values, one of
which is selected based on the value of the index.
Action
For a full discussion of the SET statement, refer to Section 4 of the
VPLUS/V Reference Manual
.
The exercise used in this guide does not need index retrieve operands, so
their use is not fully depicted here. However, since they can be useful
in many applications, you should be aware of them. One particular
application is when you design a form to act as a menu, from which the
user selects the next form. In such a case, an index retrieve operand
used with the CHANGE statement (see Section 7) can be very useful. To
illustrate,
CHANGE NFORM TO X OF FORMA, FORMB, FORMC, FORMD
Depending on the value of X, which can be assigned a numeric value as a
result of user entry on a menu form, the next form displayed is one of
the forms named in the list.