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

# GENMAINT.PUB

GENMAINT.PUB is a public program that interfaces between GENINPUT.PUB and a file maintenance program when the Maintenance key is pressed. GENMAINT.PUB is intended for use by GENINPUT.PUB only.

`0100 ENTER FIL[ALL],EDIT_DEF$,PROGID$,OSGUI$`

Variable | Description
FIL[ALL] | Standard file array
EDIT_DEF$ | Current data field value. The file maintenance program should set this field to the value of the last record saved.
PROGID$ | Name of the file maintenance program to call
OSGUI$ | GUI template (see GENGURES.PUB for more details)

Exit Points | Explanation
EXIT | GENMAINT.PUB never returns an error.

The application owning the file maintenance program is determined from the first two characters of PROGID$. GENMAINT.PUB switches to the application directory, loads the application option switches, creates a new program window and calls the file maintenance program in PROGID$ as follows:

`1150 CALL PROGID$,FIL[ALL],EDIT_DEF$,O2$`

Variable | Description
FILE[ALL] | Standard file array
EDIT_DEF$ | Current data field value. The file maintenance program should set this field to the value of the last record saved.
O2$ | Option switch settings for application specified by the first two characters of PROGID$

When control is returned to GENMAINT.PUB, the program window pops up, the current directory is restored to the original application directory, and control is returned to GENINPUT.PUB. Any additional variables that are needed from the calling application program to PROGID$ must be set in the calling application program as global variables at the time PROGID$ is set. Global variables and PROGID$ should be set only if the application being referenced exists and the application being referenced is interfaced with the current application (cross applications only).