HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
160 Chapter4
Advanced Forms Design
SET
Syntax
[SET {
destination
destination
''TO''
source
}]
Parameters
source
Can be a field name, save field name, constant, arithmetic expression, or
an index retrieve operand within parenthesis.Refer to "Statement Syntax"
earlier in this section for details.
destination
Can be a field name or save field name.
Discussion
When a source is not included, whatever value is in the current field is moved to the
specified destination. (The current field is the field in which the SET statement appears.)
Example
1. Move the value resulting from an arithmetic expression to a numeric data field AMOUNT:
SET AMOUNT TO 6 %(3*COST)
This statement multiplies the value of the field COST by 3 and then sets AMOUNT to 6
percent of the result.
2. Set the save field SF3 to the current value of the field in which the SET statement
appears:
SET SF3
Assume the current field is a character type with the value SMITH. The SET statement
moves the value SMITH to the save field SF3. SF3 must be a character type save field.
Automatic Formatting
In general, automatic formatting performed during data movement is governed by the
data type of the destination. The following discussion illustrates data movement for
various data types. Refer to Table 4-9. for a summary of the conversion performed during
data movement.
Character Type
If the destination is a character field, data moved to it does not change its relative position.
If the source is too large for the destination, the data is truncated on the right when it is
moved. If the source has fewer characters, the destination is padded with blanks on the
right.