|
» |
|
|
|
A save field is a global field whose value can be used anywhere
in the forms file where field references are allowed. Save fields
are not part of a particular form like other fields, but are "global"
to all forms. Like other fields, they always contain data in external,
character form. The save fields can be used by most processing statements,
but are particularly useful for passing data between fields on different
forms. Refer to the SET command in Section 4. A maximum of 20 save fields
can be defined for any forms file. Save fields are specified on the Save Field Menu, which is
displayed when requested on the Main Menu. Any defined save fields
are stored at the beginning of the forms file just after the global
specifications. (Refer to "Forms File" earlier in this section for
the order of specifications in the forms file.) The Save Field Menu
is illustrated in Figure 3-24 “Save Field Menu” Figure 3-24 Save Field Menu A save field name appears exactly the same as a field name.
To help distinguish the global save fields from local fields, you
may want to establish a naming convention. For example, if all save
field names (and no local field names) start with the letter SF, then any field name starting with SF is immediately recognizable as a save field. Up to 20 save fields can be defined in one forms file. The
Save Field Menu is usually requested through the Main Menu. To add
a save field, press MAIN/RESUME to request the Main Menu and then type S in the selection box and press ENTER. A blank Save Field Menu is then displayed. You can also
display a blank Save Field Menu by pressing PREV from the first Form Menu. To delete a save field, you also request the Main Menu and
then enter D in the selection box and the name of the save
field to be deleted in the field name box. Fields | |
- Save Field Name
A standard field identifier composed of up to 15
USASCII characters, beginning with an upper or lowercase letter. The
remaining characters can be upper or lowercase letters, digits,
or underlines. For example, SF3, D2 15, or ALPHA. Note that if you use a lowercase letter in a
name, FORMSPEC shifts it to an uppercase letter. (The name must
not be one of the reserved words listed earlier in Table 3-2 “FORMSPEC Reserved Word List” - Length
Like other fields, save fields must be assigned
a length, representing the maximum number of characters allowed in
the field. Note that you must supply a field length, unlike field
specifications where field length is determined from the screen
design. Since save fields may be used as accumulators, it is important
that the save field length be long enough to avoid rounding and/or
truncation when summed values are moved to the field. - Data Type
The data types allowed are the same as for any field.
The general types are character (CHAR), numeric (NUM[n], IMPn, or
DIG), or date (MDY,YMD, or DMY). (Refer to "Ease of Forms Design"
for a complete discussion of these data types.) - Initial Value
An initial value may be assigned to any save field.
This is an optional specification; if omitted, all fields are set
to blanks ($EMPTY). If specified, the initial value must be the same
type as the specified data type. Values are entered exactly as if
they were entered by a terminal user; that is, characters are not
delimited by quotes, and dates are not delimited by exclamation
points. For example: 12.5 type is NUM1 3790 type is DIG FEB 3, 86 type is MDY John type is CHAR
|
When the forms file is opened, initial values (default or specified)
are assigned to the save fields.
|