HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
Chapter 4 163
Advanced Forms Design
SET
Default Formatting
Besides the explicit formatting described below, data is formatted whenever it is moved
between fields according to the rules for automatic formatting. If you want data entered by
the user to be formatted automatically, you can specify the following version of the SET
statement.
SET TO
thisfield
Parameters
thisfield
is the name of the field in which SET appears. Essentially, you set the field
to itself.
For example, you may want to ensure that a monetary value is always right justified with
a decimal point inserted preceding two decimal positions. To do this, define the field as
type NUM2 and then use the SET statement to force data entered in this field to be
formatted. The Field Menu in Figure 4-3. illustrates this use of SET.
Table 4-9. Conversion During Data Movement
From
To
CHAR NUM NUMn IMPn DIG DATE
CHAR Truncateor
Pad with
blanks on
right
illegal illegal illegal illegal illegal
NUM Truncateor
Pad with
blanks on
right
Right
justify; Strip
leading
zeroes; Pad
leading
blanks; try
to fit 9
decimal
places,
rounding
truncating,
inserting a
decimal
point as
needed
Right
justify;
Strip
leading
zeroes; Pad
leading
blanks;
Round or
truncate
fractions,
insert
decimal
point as
needed
Right
justify;
Strip
leading
zeroes even
if
fractional;
Padleading
blanks
remove any
decimal
point.
Right
justify;
Strip
leading
zeroes; Pad
leading
blanks.
Value must
be positive)
illegal
NUMn illegal
IMPn illegal
DIG illegal
DATE Truncateor
Pad with
blanks on
right
illegal illegal illegal illegal Convert to
dd/dd/dd in
order of
destination;
Left justify;
Pad trailing
blanks