https://github.com/jrincayc/ucblogo-code
Revision 68a93248641e91314d2700e8a3c6ba0c73ba5422 authored by Joshua J. Cogliati on 27 December 2021, 16:56:40 UTC, committed by Joshua J. Cogliati on 27 December 2021, 16:56:40 UTC
1 parent e3a5d7a
Raw File
Tip revision: 68a93248641e91314d2700e8a3c6ba0c73ba5422 authored by Joshua J. Cogliati on 27 December 2021, 16:56:40 UTC
Updating version to 6.2.2pre1
Tip revision: 68a9324
openwrite
OPENWRITE filename

	command.  Opens the named file for writing.  If the file already
	existed, the old version is deleted and a new, empty file created.

	OPENWRITE, but not the other OPEN variants, will accept as input
	a two-element list, in which the first element must be a variable
	name, and the second must be a positive integer.  A character
	buffer of the specified size will be created.  When a SETWRITE is
	done with this same list (in the sense of .EQ, not a copy, so
	you must do something like
		? make "buf [foo 100]
		? openwrite :buf
		? setwrite :buf
		    [...]
		? close :buf
	and not just
		? openwrite [foo 100]
		? setwrite [foo 100]
	and so on), the printed characters are stored in the buffer;
	when a CLOSE is done with the same list as input, the characters
	from the buffer (treated as one long word, even if spaces and
	newlines are included) become the value of the specified variable.

back to top