OPENWRITE

Synopsis
OPENWRITE filename
(OPENWRITE filename binarymode)
Description

Opens the file named filename for writing. If the file by the given filename already exists, the old version is deleted and a new, empty file is created.

filename can also be the reserved word "clipboard to write data to the clipboard just like a file.

The binarymode is a boolean value (TRUE or FALSE). If binarymode is FALSE or not given, then the file is written as a text file. That is, the end-of-line sequence is converted from LF to CRLF. If binarymode is TRUE, then the file is written as a binary file. That is, no end-of-line sequence conversion is performed.

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
CLOSE

SourceForge.net Logo