REM Purpose:  Verify SEEK, LOC, and LOF
REM  Author:  Howard Wulf, AF5NE
REM    Date:  2015-02-21
REM

OPEN "E063.DAT" FOR OUTPUT AS #1

PRINT "AT END OF NEW EMPTY FILE"
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT

PRINT "AT END OF NON-EMPTY FILE < 128"
PRINT #1, "12345678";
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT

PRINT "AT END OF NON-EMPTY FILE = 128"
FOR I = 1 TO 12
PRINT #1, "1234567890";
NEXT I
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT


PRINT "AT START OF NON-EMPTY FILE = 128"
SEEK #1, 1
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT

PRINT "AT END OF NON-EMPTY FILE = 128"
SEEK #1, LOF(#1)
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT
CLOSE #1


OPEN "E063.DAT" FOR INPUT AS #1

PRINT "REAAD CHAR AT START OF NON-EMPTY FILE = 128"
LET A$ = INPUT$(1, #1)
PRINT "  A$=";"[";A$;"]"
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT

PRINT "READ CHAR AT END OF NON-EMPTY FILE = 128"
SEEK #1, LOF(#1)
LET A$ = INPUT$(1, #1)
PRINT "  A$=";"[";A$;"]"
PRINT "LOC =";LOC(#1)
PRINT "LOF =";LOF(#1)
PRINT "SEEK=";SEEK(#1)
PRINT

CLOSE #1

END
