You are here: Development Standards > Routines > General Routines > GENLOCK

# GENLOCK

GENLOCK is general routine that interfaces to GENERROR.PUB for handling program errors and ESCAPEs. GENLOCK occupies lines 9300–9399 and should be merged into all non interactive programs. The description of GENERROR details all variables that are passed to GENERROR.PUB. Below are the variables that are relevant to GENLOCK:

Variable | Description
O7 | GENLOCK sets O7 to -1 to indicate that an automatic retry should occur if the current error warrants a retry attempt. O7 is set to -2 to indicate that an Escape was detected. O7 is set to 0 before GENERROR.PUB exits.
Y$ | Y$ is set to the appropriate value after a key is pressed before GENERROR.PUB exits. For an automatic retry, Y$ is set to "R", the message is displayed, and there is a slight pause until GENERROR.PUB exits.
X1$ | Mask that caused a mask format error
F$ | File name that caused a file error
YDISABLE$ | String of Y$ values that should be ignored. Note that only ESC sequence commands can be disabled (that is, Esc+X for Abandon, but not Ctrl+K for Up)
OSGUI$ | GUI template (see GENGURES.PUB for more detail)

Exit Points | Explanation
RETURN | GENLOCK returns after an Escape is detected, but the user elects to continue processing.
GOTO 9990 | Y$ = "M" for an Exit key press (and verified if necessary).
RETRY | A RETRY is attempted for all other values of Y$.