POP – Removes one address off the stack of GOSUB addresses so the next RETURN
ill branch one statement beyond the second most recently executed GOSUB.
PTR – Followed by two values allows the setting of selected scratch pad
locations without using POKE or DOKE. The advantage of this is that the XBASIC
workspace area is different for various implementations. For example the
worksp-ace locations in the Nas-Dos version starts at 1006H but in the CP/M
implementation, it is at 0100H. Thus some compatability is achieved. There are
24 selected locations. e.g. A=PTR(14) places the address (in decimal!) of the
end of the XBASIC program currently in memory into variable A.
SCRN$ – Followed by a number which must be less than the number of rows on the
screen (16 on a standard Nascom), returns the string of characters from this
row number, the length of which will always be equal to the number of columns
on the screen (48 on a standard Nascom).
SEP – Followed by an ASCII value alters the seperator found in input
statements – normally a comma. e.g. SEP 47 makes / the seperator. SEP 0 allows
any characters to be input in INPUT statements including commas – although in
this case, only one input at a time would be allowed.
SIZE – Returns the current space available for program use. As for FRE(0) in
SPEED – Followed by a number from 0 to 255 sets a delay in the character
output to the current output device. 0 is very slow whilst 255 is normal
SWAP – Followed by two variables swaps the contents of the variables which may
be numeric or string types. Saves a lot of space in sort routines.
ZONE – Followed by two numbers sets the print zone (tab) width and the largest
column for which printing to the next zone will stay on the same line. Default
values for a standard Nascom are 14 and 36 respectively.
ON ERR – Errors can be trapped and dealt with as you desire. It is possible to
deal with certain errors only and then continue in the program whilst
unexpected errors will still break out of the program. The function ERL
returns the line number where the error occurred, ERR returns the number of
the type of error –there is a list in the manual, ERRS$ returns the error
string message without the word “error”.
OFF ERR – Turns off the ON ERR command. An ON ERR command will turn off anyway
after an error has occurred in case the error routine has an error in it(!)
but the error dealing routine can always turn it back on again at the end of
ON EOF – As for ON ERR except that this deals specifically with the encounter
of an end of file when reading disk or tape data files and which would
normally cause an End of Text Error. If ON ERR and ON EOF are both in force
then the latter takes precedence if an end of file condition is sensed. The
main difference between the two error handling statements is that the ON EOF
routine does not turn off after an EOF error.