SETREAD

Synopsis
SETREAD filename
Description

Sets the read stream to the file named filename. The read stream is used by READLIST, READWORD, etc. The file must already be open with OPENREAD or OPENUPDATE. If the input is the empty list, then the read stream becomes the Commander, as usual. Changing the read stream does not close the file that was previously the read stream, so it is possible to alternate between files.

If you CLOSE the current reader, then the read stream is closed and READER is changed back to the Commander.

Example
OPENWRITE "dummy.fil
SETWRITE "dummy.fil
PRINT "Hello
PRINT [Good Bye]
SETWRITE []
CLOSE "dummy.fil

OPENREAD "dummy.fil
SETREAD "dummy.fil
REPEAT 2 [SHOW READLIST]
[Hello]
[Good Bye]
SETREAD []
CLOSE "dummy.fil
See Also
SETWRITE
READER

SourceForge.net Logo