READPOS

Synopsis
READPOS
Description

Outputs the byte position of the current read stream's file as a number. READPOS outputs 0 when the read position is at the beginning of the file.

READPOS outputs -1 when the current read stream is the Commander.

Example
OPENWRITE "example.txt
SETWRITE "example.txt
PRINT "Hello
PRINT [Good Bye]
SETWRITE []
CLOSE "example.txt

OPENREAD "example.txt
SETREAD "example.txt
REPEAT 2 [SHOW READPOS SHOW READLIST]
0
[Hello]
7
[Good Bye]
SETREAD []
CLOSE "example.txt

SourceForge.net Logo