AT FIELD


AT FIELD is used to see if the cursor is positioned at a specified field within the current image of a menu or input process, usually as one part of a conditional check.

    ••••• AT FIELD ••• •••••••••••••••••••••• ••• (AT APPEARANCE # •••)
    (1)            (2) (3)                    (4)                  (5)

(1) T/F execution conditions

(2) Application ID

(3) Field name or predefined field

(4) Occurrence (constant/index)

(5) Appearance (constant/index)

Sets True/False Status Indicator

If the cursor is positioned on the field specified (including the occurrence and appearance numbers if so specified), the next level of the true/false status indicator is set to T; otherwise, it is set to F. If you leave the occurrence number blank, cursor positioning on any occurrence of the specified field results in a true condition. If you leave the appearance number blank, cursor positioning on any appearance of the specified field results in a true condition.

If you leave field name blank, the AT FIELD statement returns a true value if the cursor is positioned in an item corresponding to any field within the specified application. If you leave all the parameters blank, the AT FIELD statement returns a true value if the cursor is positioned in any item within the current image.

Restrictions

The AT FIELD statement is valid only within the Option Intercept or Global Option Intercept event point. If you attempt to add this statement in any other event point, you will receive a warning that states "Warning - This statement has no effect in this event point". However, if the AT FIELD statement is encountered at compile time or runtime in any other event point, it is simply ignored. No other errors or warnings are generated.

Related PDFs

The system automatically sets the predefined fields, CURSOR AT OCCURRENCE and CURSOR AT APPEARANCE, to the corresponding values of the occurrence and appearance numbers for the field on which the cursor is positioned.

Example

The following example shows how to use AT FIELD as the first conditional check to determine the course of further processing. In this example, AT FIELD is used with an IF statement to check which option a user has selected while positioned on the designated field. The intention of the statement series is, “If a user is positioned on field A, and then selects option 3, take the following actions...”.

          AT FIELD TAR CUSTOMER ID                (AT APPEARANCE #    )
    T     IF       --- OPTION                     EQ     USER 3
    TT    SET      TAR WORK MESSAGE               =      ENTER CUSTOMER ID
    TF    SET      TAR WORK MESSAGE               =      ENTER INVOICE NUMBER