HP 3000 Manuals

FIELD Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 2

FIELD Command 

The FIELD command changes the attributes or behavior of one or more
fields on the current screen.

Formats 

FIELD {[*DEFAULT] [*INPUT  ] [*REQUIRED] [*ECHO  ] [[attribute]...]}
      {           [*DISPLAY] [*OPTIONAL] [*NOECHO]                 }

[from_data_ref [to_data_ref]]

Parameters 

from_data_ref, to_data_ref 

The starting and ending field numbers to be changed.  Each can be one of
the following:

   *   Whole number.

   *   Screen field name.

   *   * (representing the current field+).

   *   Relative screen field reference such as *-9 to *+9.

In the FIELD command you can specify a screen field by the field name
only.  You can optionally omit the screen name.  If you specify only one
data reference, HP ALLBASE/4GL changes the attributes or behavior of that
field only.

If you don't specify any data references, the FIELD command applies to
all fields on the screen.

attribute 

The attributes that you want to apply to the named screen fields.
Attribute can be any of the following:

             Color Attributes                          Highlight attributes 

                  *BLACK                    *NOINV

                   *BLUE                    *INV

                   *CYAN                    *FBRIGHT

                  *GREEN                    *HBRIGHT

                 *MAGENTA                   *BLINK

                   *RED                     *NOBLINK

                  *WHITE                    *ULINE

                  *YELLOW                   *NOULINE

Description 

The FIELD command allows you to change the attributes or behavior of one
field or a range of fields on the current screen.  Attribute keywords can
be listed in any order after the FIELD command.

All attributes changed by this command remain in effect until they are
changed by another FIELD command or a different screen is displayed.

If you specify both a from_data_ref and a to_data_ref with the FIELD
command, HP ALLBASE/4GL changes the attributes of all fields in the range
on the current screen.  If the from_data_ref is greater than the
to_data_ref, the FIELD command doesn't change the attributes of any
field.

If you use the FIELD command to change an attribute of a field and the
field already has that attribute, no change is noticeable to the user.

The *INPUT and *DISPLAY keywords change the specified field or fields to
be either input or display fields.  The field highlighting changes to
reflect the system-wide specifications set by the system administrator on
the terminal display control screen.

When a field attribute is explicitly set by a FIELD command, that
attribute is not altered by a subsequent FIELD *INPUT or FIELD *DISPLAY
command.  For example, assume that a field attribute for input fields is
the color yellow and a field attribute for display fields is the color
cyan.  If a FIELD *RED command is executed on an input field, the input
field changes to the color red and remains in inverse video.  If a FIELD
*DISPLAY command is executed on the field sometime later, the field
becomes a display field and exhibits all the attributes of a display
field except that it remains red in color because of the previous FIELD
command.

The *REQUIRED and *OPTIONAL keywords change the specified field or fields
to be either required or optional.


NOTE Changing this field attribute can affect the flow of the screen logic. If the field is changed from being optional to being required, it can never be left blank. Therefore, the contents of the After Function if Blank field on the screen field details screen has no effect. However, if the field is changed from being required to being optional, the contents of the After Function if Blank field determines whether any after function is executed.
The *ECHO and *NOECHO keywords control whether user input is displayed (echoed) on the screen or not. *NOECHO is particularly useful for password fields as it allows the user to enter a password without displaying the password on the screen. The color keywords change the specified fields to the specified color. The *INV and *NOINV keywords change the field attributes to and from inverse video. The *FBRIGHT and *HBRIGHT keywords change the field attributes to and from full brightness and half brightness. The *BLINK and *NOBLINK keywords change the field attributes to and from blinking. The *ULINE and *NOULINE keywords change the field attributes to and from being underlined. The *DEFAULT keyword resets the specified screen fields back to their original behavior and highlighting attributes. If HP ALLBASE/4GL detects conflicting keywords in a FIELD command when it generates a logic block, it displays an error message.
NOTE Some terminals cannot support all the above attribute changes. In that case, the terminal's default setting is displayed.
Example 1 FIELD *DISPLAY 1 10 This command changes fields 1 to 10 to display fields. Each of these fields appears to the user to be display only. Example 2 FIELD *OPTIONAL S-customer S-zip_code This command changes the customer and zip_code fields and all intervening fields to optional fields. If any of these fields were already optional, their behavior is unchanged. However, if any field was required, the behavior changes as follows. If the After Function if Blank field on the screen field details screen is marked as Y, the after function is always executed. If the After Function if Blank field is marked as N (the default value), the after function is not executed if the screen field is left empty. Example 3 FIELD *FBRIGHT *INV This command changes every field on the current screen to full-bright and to inverse video. Example 4 FIELD *DEFAULT *RED 2 4 This command resets the attributes of fields 2 through 4 back to their defaults and then changes the fields to the color red.


MPE/iX 5.0 Documentation