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

# GENSAVE.PUB

GENSAVE.PUB is a public program used to save a workstation's status before releasing to the operating system. This program should be called just before executing a RELEASE verb with a parameter that will reinvoke OSAS.

`0050 ENTER PROGRAM$,MENUSTATE$`

Variable | Description
PROGRAM$ | Program name to return to when reentering OSAS
MENUSTATE$ | Current menu state before exiting (STBL("MENUSTATE"))

GENSAVE.PUB saves the following to the file RESTART.{workstation ID}:

Variable | Description
PROGRAM$ | Current program name
STBL ("ACCESSCODE") | Current access code
STBL("JULDATE") | Current Julian date
STBL("DATE") | Current workstation date
MENUSTATE$ | Current menu state

RMSETUP looks for the existence of this file during startup and restores the data if the file is found.

If PROGRAM$ is set to null, the workstation returns to the main menu after reentering OSAS. Otherwise, the workstation returns to the program from where it was released.

If PROGRAM$ contains a value other than null, the global variable STBL("RESTART") must be cleared before running O1$ (RMMENU) or the workstation will be returned to the program from where is was released. Place the following line somewhere before the line RUN O1$ in the QUIT section of a program using GENSAVE.PUB:

`9998 LET DUMMY$=STBL("!CLEAR","RESTART")`