HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 128
After a GOSUB statement is executed, the subroutine to which it transfers
control is "open". When a matching RETURN statement is executed, the
subroutine is "closed." An error occurs if a RETURN statement is executed
when no subroutine is open.
10 REM Main Program Unit
20 GOSUB 100 !Open subroutine at line 100
25 RETURN !No open subroutine;error occurs
30 STOP
100 REM Subroutine
110 PRINT "In sub"
120 RETURN !Close subroutine; return to line 30
999 END
SAVE KEY
The SAVE KEY statement's action is dependent on whether a filename
parameter is included in the statement. If a filename parameter is
included and the file does not previously exist, the SAVE KEY statement
stores the typing aid definitions in a BKEY file. The file to which the
information is saved has a special format and a BKEY file code. If no
filename parameter is specified, the SAVE KEY statement causes HP
Business BASIC/XL to store the current typing aid key definitions
internally as the current definition. The SAVE KEY statement does not
save information for keys defined as branch-during-input keys, it saves
only the key definition information for keys defined as typing aid definitions.
The SAVE KEY statement saves key labels, it does not save any actions
that a program has set up when it traps those labeled keys. If a key is
pressed, it will paint the screen. Any actions associated with that key
have not been saved so they will not be performed.
NOTE It is important to do a SAVE KEY without the
fname
parameter
following the initial setting of the fields of the user-definable
keys for use as typing aid keys.
If this is not done, exiting from a program containing an OFF KEY
statement restores the user-definable keys to the values present before
you set those displayed on entry to the program. If you had just entered
the interpreter, the values of the typing aid keys are restored to the
terminal's default typing aid key definitions rather than your
user-defined typing aid keys. In other words setting the typing aid key
definitions and then executing, a program containing the OFF KEY
statement, restores the terminal's default typing aid definitions.
HP Business BASIC/XL stores the values of typing aid keys internally.
SAVE KEY without an
fname
parameter can be used in conjunction with GET
KEY without an
fname
parameter to access HP Business BASIC/XL's
internally stored values. The GET KEY statement without an
fname
parameter restores the definitions of the keys present at the last
previous SAVE KEY statement without an
fname
parameter if the following
condition is met: no other SAVE KEY, RESAVE KEY, GET KEY or SCRATCH KEY
statement precedes the GET KEY statement without an
fname
parameter.
Thus, GET KEY can be used without an
fname
parameter to restore
definitions of any of the fields changed by the method outlined in the
terminal's reference manual.
Syntax
SAVE KEY [
fname
]
Parameters
fname
A file name represented by a quoted string literal, an