$CHKSFLD

From m204wiki
Revision as of 13:18, 20 April 2013 by Alex (talk | contribs) (Automatically generated page update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Use the $CHKSFLD function to determine whether a display attribute is applied to a screen item for a specified type of screen processing.

Syntax

$CHKSFLD(screen-name,item-name,display-attribute, [process-type])

Where

  • Both the screen-name and item-name arguments are expected to be string expressions and can include quoted strings, %variables, field names, or functions.
  • display-attribute value can be one of the following:
  • Value Meaning
    'ASK' Auto-skip
    'BLI' Blink
    'BLU' Blue color
    'BRI' Bright
    'DEF' Default color
    'GRE' Green color
    'INV' Invisible
    'NUM' Numeric field
    'PIN' Pink color
    'PRO' Protected
    'RED' Red color
    'REV' Reverse image
    'TUR' Turquoise color
    'USC' Underscore
    'WHI' White color
    'YEL' Yellow color
  • process-type can be one of the following:

'PRINT'

'READ' (the default)

'REREAD'

'TAG'

Returns

  • 1 if the attribute is ON for the type specified.
  • 0 if the attribute is OFF for the type specified.

Usage

For example, if you want to check whether the POLNO (policy number) field in the screen MAIN is displayed in blue in reread processing, enter the following command:

BEGIN SCREEN MAIN INPUT POLNO AT 10 LEN 20 RED END SCREEN MODIFY %MAIN:POLNO TO BLUE FOR REREAD PRINT $CHKSFLD('MAIN','POLNO','BLU','REREAD') END

Produces the following output:

1

Nonfatal errors

If you do not specify colors within the Model 204 screen definition, the color displayed on your terminal is the default color display. For example, you might be looking at a pink display, but when you invoke the $CHKSFLD function, checking for 'PIN' does not return a '1' because pink was not assigned by the Model 204 screen definition.

The following messages might be issued:

M204.2462: INVALID ATTRIBUTE SPECIFIED: attribute M204.2462: INVALID ATTR.TYPE SPECIFIED: attr.TYPE M204.0329: SCREEN OR IMAGE ITEM NAME NOT FOUND: name M204.0324: SCREEN, MENU, OR IMAGE NAME NOT DEFINED: name M204.0247: SCREEN, MENU, OR IMAGE NAME NOT SPECIFIED