You are here: Development Standards > Routines > General Routines > GENGUHLP.PUB

# GENGUHLP.PUB

GENGUHLP.PUB is a public program that displays context-sensitive field help in GUI mode. This program is CALLed by GENGUINP.PUB and is invoked when the Help key is pressed. All parameters originate from GENINPUT.

`0100 ENTER HID$,ROW,COL,PAGE,FILE[ALL],FLD_HLP$,OSGUI$`

Variable | Parameter | Description
HID$ | PGM(-2) | Program name
ROW | X0 | Row of data field
COL | X1 | Column of data field
PAGE | X2 | Screen page number
FILE[ALL] | FILE[ALL] | The standard file channel array
FLD_HLP$ | FLD_HLP$ | Help screen ID
OSGUI$ | OSGUI$ | GUI template (see GENGURES.PUB for more detail)

Exit Points | Explanation
EXIT3 | GENGUHLP.PUB normally exits with no error
EXIT ERR | An error is returned when an error occurs.

The GENGUHLP.PUB program performs these functions:

- OPENs the help data file, xxHELP (where xx is the application ID)
- reads the help record, KEY=HID$+PAGE+ROW+COL
- displays a window with a help record or a No Help Available message
- accepts a command character
- allows for an exit window, a delete help record, an add/change help record, and highlighting of key words

The routine traps errors and returns them to the CALLing program. The routine uses the SETESC verb to prohibit the user from pressing Ctrl+Break and exiting from the program. The access code for MACHELP is checked before help can be edited or deleted. In edit mode GENGUHLP.PUB uses GENINPUT. To highlight key words (display in foreground), place braces ({}) around the words. When you exit from edit mode, the help message is redisplayed.

The PAGE variable allows screen locations that are used more than once in the same program. It should be initialized to 0 upon display of the first screen and adjusted as program logic dictates. Generally, this change takes place in the data prompt sections.