![QSI QTERM-R55 User Manual Download Page 26](http://html1.mh-extra.com/html/qsi/qterm-r55/qterm-r55_user-manual_3304037026.webp)
16
QTERM-R55 User's Manual
QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770
print #<1-9> <str$>
prints
str$
(writes) to the
end of a currently open file.
input #<1-9> <str$>
reads from a currently open
file until it reaches a newline character.
eof (#<1-9>)
determines if the end of a file has been
reached when reading.
close #<1-9>
closes a currently open file.
system (“erase filespace”)
or
system$
(“erase filespace”)
erases the filespace.
system (“avail filespace”)
or
system$
(“avail filespace”)
is a pessimistic indication of
how much free area exists for writing more data.
seek #<1-9> to line <expression>
allows
random access to an open file in the filespace. This com-
mand will evaluate
<expression>
to a positive integer
n (dropping fractions) and will position a file pointer at the
beginning of the nth line in the specified file. Subsequent
input
command will read the file at this location. A line
is defined as any sequence of bytes ending in the newline
character.
seek #<1-9> <expression> lines
is similar to
the
seek
command above, except that it positions the file
pointer relative to the current file pointer location rather
than to an absolute line number. This command evaluates
<expression>
to a positive or negative integer n (drop-
ping fractions) and positions the file pointer to the begin-
ning of the nth following line (for positive n) relative to the
current file pointer location in the specified file. Subse-
quent
input
command will read the file at this location.
command can only be used to write to a file if it has
been opened for appending and the current file pointer loca-
tion is at the end of the file.
Note that the
and
input
commands automatically
position the file pointer to the beginning of the following
line after reading/writing the file.
2.11
Error Handling
There are two types of error handling statements that can be
used:
on error goint <label>
on lowbat goint <label>
The first statement sets the terminal so that if it encounters
a non-fatal error, it will begin execution of a special sub-
routine starting at the location given by the label rather than
sending the error description to the primary serial port and
aborting the program. Any subsequent errors encountered
while handling that error, however, will not call the error
handler but a description will be sent to the primary serial
port. The error that caused the interrupt may be found in the
error handling routine by using the command
peek$(“error”)
. The resulting string of this function
will contain the error information.
The lowbat handling routine will also call a subroutine
starting at the location given by the label, assuming the unit
is designed for battery operation. If there is no error han-
dler, and the unit’s battery is getting low, it will beep peri-
odically instead.
IMPORTANT NOTE: While in these interrupt handlers,
one should not attempt to perform any type of input pro-
cessing from the keypad or communications port that sus-
pends program flow. Interrupt handlers should be simple
and quick and should return with a gosub at the end of the
routine (subroutine calls are allowed inside the handler and
will be handled appropriately).