EasyManua.ls Logo

Husky Hunter - Page 244

Husky Hunter
499 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC FUNCTIONS SECTION 5.13
5.13.12
Function LOC returns the number of records read/written to a
sequential file
Syntax
LOC(file no)
Example 100 MAXFILES=2
110 OPEN
11
TEST
11
FOR INPUT AS 112
120 INPUT/12,A
130 IF EOF(2)=0 THEN GOTO 120
140 PRINT"End of File"
150 PRINT
11
No. of records read = ";LOC(2)
160 CLOSE/12
170 END
When the end of file has been reached the number of records
that have been read will be displayed.
Remarks The LOC(n) function can also be used to display the number
of records written to a file.
VER.V09F
NOTE: the program to create the data file TEST could be of
the form:
10 OPEN "TEST" FOR OUTPUT AS/11
20 FOR X=1 TO 100
30 WRI TE/11 , X
40 NEXT
50 CLOSE/11
60 END
NOTE: A record consists of 128 bytes, so LOC gives a
measure of the amount of file space used.
PAGE 5 - 75