IBM AS/400 Frozen Dessert Maker User Manual


 
Using Externally Described WORKSTN Files
Specifying Function Key Indicators on Display Device Files
The function key indicators, KA through KN and KP through KY are valid for a
program that contains a display device WORKSTN file if the associated function
key is specified in the DDS.
The function key indicators relate to the function keys as follows: function key indi-
cator KA corresponds to function key 1, KB to function key 2 ... KX to function key
23, and KY to function key 24.
Function keys are specified in the DDS with the CFxx (command function) or CAxx
(command attention) keyword. For example, the keyword CF01 allows function key
1 to be used. When you press function key 1, function key indicator KA is set on in
the RPG program. If you specify the function key as CF01 (99), both function key
indicator KA and indicator 99 are set on in the RPG program. If the work-station
user presses a function key that is not specified in the DDS, the OS/400 system
informs the user that an incorrect key was pressed.
If the work-station user presses a specified function key, the associated function
key indicator in the RPG program is set on when fields are extracted from the
record (move fields logic) and all other function key indicators are set off. If a func-
tion key is not pressed, all function key indicators are set off at move fields time.
The function key indicators are set off if the user presses the Enter key.
Specifying Command Keys on Display Device Files
You can specify the command keys Help, Roll Up, Roll Down, Print, Clear, and
Home in the DDS for a display device file with the keywords HELP, ROLLUP,
ROLLDOWN, PRINT, CLEAR, and HOME.
Command keys are processed by an RPG program whenever the compiler proc-
esses a READ or an EXFMT operation on a record format for which the appropriate
keywords are specified in the DDS. When the command keys are in effect and a
command key is pressed, the OS/400 system returns control to the RPG program.
If a response indicator is specified in the DDS for the command selected, that indi-
cator is set on and all other response indicators that are in effect for the record
format and the file are set off.
If a response indicator is not specified in the DDS for a command key, the following
happens:
For the Print key without *PGM specified, the print function is processed.
For the Roll Up and Roll Down keys used with subfiles, the displayed subfile
rolls up or down, within the subfile. If you try to roll beyond the start or end of a
subfile, you get a run-time error.
For the Print Key specified with *PGM, Roll Up and Roll Down keys used
without subfiles, and for the Clear, Help, and Home keys, one of the *STATUS
values 1121-1126 is set, respectively, and processing continues.
334 ILE RPG for AS/400 Programmer's Guide