Tips and Techniques: ENTFLDATR

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Recently, I rediscovered the ENTFLDATR keyword. This NPTUI (pronounced "en-pa-tooy") keyword allows you to set the field attribute for an input field when the cursor enters the field.

The keyword allows you to make a boring old 5250 green-screen application behave a little more like a PC GUI by changing the field attributes when the user tabs or cursors into the field.

The variation of this keyword I prefer to use is to make the field reverse image when the cursor enters it. To do this, specify the following keyword, either at the record level or on the field itself.

ENTFLDATR((*DSPATR RI))

This provides a very cool-looking effect. If you've ever wondered how the DBU product does what it does with its user interface, this is probably it.

For a quick example of how this keyword works, enter the following DDS and stub it into a program. Then, do an EXFMT on the DSPREC record format. As you tab from field to field, the attributes will automatically change from underline to reverse image.

 

A          R DSPREC                    CF03
A                                      ENTFLDATR((*DSPATR RI))
A                                  8  9'Name . . . . . . '
A            CMPNAME       35A  B  8 27
A                                  9  9'Address  . . . . '
A            ADDR1         30A  B  9 27
A            ADDR2         30A  B 10 27
A                                 11  9'City . . . . . . '
A            CITY          30A  B 11 27
A                                 12  9'State  . . . . . '
A            STATE          2A  B 12 27
A                                 13  9'Zip code . . . . '
A            ZIPCDE        10A  B 13 27
A                                 14  9'Phone number . . '
A            PHONE         14A  B 14 27
A                                 15  9'email  . . . . . '
A            EMAIL         50A  B 15 27

Figure 1: Here's a sample display file using the ENTFLDATR keyword.

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$