Functions
7-4

DSKF

The DSKF function returns the number
of
128-byte sectors
that
are free
on
the
specified disk. The examples below signify
that
there are
50*
128,
or
6.4 kilobytes
of
free space on disk
1.
DSKF
(drive
number)
PRINT DSKF (1)
50
OK

EOF

The
EOF
function detects when the end
of
the file
is
reached when reading a sequen-
tial
data
file.
If
there are no more
data
in
the file, EOF returns a -1, indicating
TRUE.
At
any other time,
EOF
will return 0, indicating FALSE.
If
the file
is
not
open, an error results.
EOF
(file
number)
10
OPEN
"1",1,
"[F1:
PROGRAM]
20
IF EOF(1) THEN
60
30
LINE INPUT
#1,
A$
40
PRINT
A$
50
GOT020
60
END
ERL
The
ERL
function returns the number
of
the line in which the last error took place.
It
is
normally used after an ON ERROR GOTO ... error trapping routine.
ERL
The program below uses the error-trapping instruction in line
10
to print the error
description in line 40. This line also contains the function ERR, which displays the
code number
of
the error. In this example the error
is
division by 0, which has the
error code
11:
10
ON ERROR GOTO
40
20
A =

1/0

30
END
40
PRINT
"PROGRAM
ENDS IN
LlNE"ERL"WITH
ERROR"ERR
50
RESUME NEXT
RUN
PROGRAM ENDS IN LINE
20
WITH ERROR
11
Ok
ERR
The
ERR
function returns the code number
of
the last error encountered during pro-
gram execution.
ERR
BASIC-SO