contents.gifindex.gifprev1.gifnext1.gif

6.5.4 Comparison to Field-level

The following paragraphs compare a field-level DISPLAY and ACCEPT to a form-level DISPLAY and ACCEPT for the same data. Both examples display a simple name and address form, and prompt the user to enter data.

Field Level ACCEPT & DISPLAY:


DISPLAY-AND-ACCEPT-ADDRESS.

DISPLAY "Name:", ERASE SCREEN, LINE 1.
DISPLAY "Address 1:", LINE 2.
DISPLAY "Address 2:", LINE 3.
DISPLAY "City:", LINE 4, "State:", COLUMN 25.
ACCEPT NAME, LINE 1, COLUMN 12.
ACCEPT ADDRESS-1, LINE 2, COLUMN 12.
ACCEPT ADDRESS-2, LINE 3, COLUMN 12.
ACCEPT CITY, LINE 4, COLUMN 12.
ACCEPT STATE, LINE 4, COLUMN 32.

Form-level DISPLAY and ACCEPT (Screen Section):


SCREEN SECTION.

01 ADDRESS-SCREEN.
03 ERASE SCREEN.
03 "Name:".
03 TO NAME, COLUMN 12.
03 "Address 1:", LINE + 1.
03 TO ADDRESS-1, COLUMN 12.
03 "Address 2:", LINE + 1.
03 TO ADDRESS-2, COLUMN 12.
03 "City:", LINE + 1.
03 TO CITY, COLUMN 12.
03 "State:", COLUMN 25.
03 TO STATE, COLUMN 32.


DISPLAY-AND-ACCEPT-ADDRESS.

DISPLAY ADDRESS-SCREEN.
ACCEPT ADDRESS-SCREEN.

There are three primary advantages of the Screen Section:

gt490000.gif The centralized screen definition is easier to maintain, especially when screen processing occurs in more than one place in the program.

gt490000.gif Automatic handling of arrow keys allows the user to move between fields without specialized programming.

gt490000.gif Users gain improved automatic mouse handling on systems where the mouse is supported.