Tandy 1000 Basic Reference Manual page 209

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10 I
BASIC Ke.ywords
LOC
Function
LOC(buffer)
Returns the current record position within a file.
Buffer is the number assigned to the file when you opened it.
You use
LOC
to determine the current record position, that is,
the number of the last record processed since you opened the file.
When used with direct access files,
LOC
returns the record
number accessed by the last GET or PUT statement.
When used with sequential files, LOC returns the number of
128-byte blocks that have been read or written.
Example
I F L O C ( 1 ) > 5 5
THEN END
Program execution ends, if the current record position is greater
than 55.
Sample Program
1 3 1 0
CIS
=
"WILLICIM W I L S O N "
1 3 2 0 GET 1
1 3 3 0 I F N $
=
A $ THEN P R I N T "FOUND
I N RECORD"
L O C C I ) :
C L O S E :
END
1 3 4 0 G O T 0 1 3 2 0
This is a portion of a direct access program. Elsewhere the file
has been opened and fielded.
N$
is a field variable. If N$
matches A$, the record number in which it was found is printed.
207

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents