SETWRITE

Synopsis
SETWRITE filename
Description

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

If you CLOSE the current writer, then the write stream is closed and WRITER 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
SETREAD
WRITER

SourceForge.net Logo