OPEN.OUTPUT
Syntax OPEN.OUTPUT
 
Explanation The OPEN.OUTPUT command opens a new Output window and returns a channel number which may be assigned to STANDARD.OUTPUT for subsequent output operations. Closing the window also closes the I/O channel, and closing the I/O channel also closes the window.

An Output window displays all types of text. In addition, you may use special characters to control the position where the next text is to be printed. These special characters all begin with the tilde '~' character, followed by a command character. The escape character may be changed by setting the ESCAPE property of the Output window. Also, the I/O channel number of an Output window is stored in the CHANNEL property of an Output window.

An Output window may also be created with the DECLARE and NEW commands, using OUTPUT as the name of the object to create.

There are the following commands defined:

~L Moves left one character. At the beginning of a line, moves to the last character of the previous line.
~R Moves right one character. At the end of a line, moves the the beginning of the next line.
~U Moves to the previous line.
~D Moves to the next line.
~B Moves to the beginning of the current line.
~E Moves to the end of the current line.
~H or ~A Moves to the beginning of the text.
~Z Moves to the end of the text.
~I Toggles between insert and overtype mode (default is insert mode).
~C Erases the contents of the window.

The Output window also recognizes three special control characters which must be printed with the CHAR command:

CHAR 8 Deletes the character to the left.
CHAR 9 Advances to the next tab stop (see the TAB system variable).
CHAR 127 Deletes the character to the right.

The Output window has the same properties as any window. Additionally, the read only proerty CHANNEL contains the channel number assigned to the window. Use the NEW or DECLARE commands to create an output window with a given name.

Examples OPEN.OUTPUT
Result: 3
MAKE "STANDARD.OUTPUT 3
PRINT [HELLO WORLD]

The text HELLO WORLD appears in the output window.

TYPE "~H~ICIAO,

The position is moved to the beginning of the text, the Output window is switched to overtype mode, and the text HELLO is replaced with CIAO. The text now reads CIAO, WORLD

TopIndex