STANDARD.INPUT

Syntax

MAKE "STANDARD.INPUT streamnumber

Explanation

STANDARD.INPUT is a pre-defined name which controls the source of the Logo input stream. When Logo starts up, the default value of STANDARD.INPUT is 0, which means that all input into Logo is read from the keyboard.

To change the source of the input stream to another device such as disk file, the device must be opened or created to prepare it for input, and STANDARD.INPUT assigned a new value.

To redirect Logo's output stream, use STANDARD.OUTPUT. See also OPEN and CREATE.

Example

The following procedures print the contents of a file to the screen.

TO ECHO :FILE


 * IF NOT FILE? :FILE (PR :FILE[DOES NOT EXIST]) STOP


 * MAKE "OLDSTREAM :STANDARD.INPUT


 * MAKE "STANDARD.INPUT OPEN :FILE


 * ECHO.CHARS


 * CLOSE :STANDARD.INPUT


 * MAKE "STANDARD.INPUT :OLDSTREAM

END

TO ECHO.CHARS


 * MAKE "CHAR RC


 * IF :CHAR = "EOF STOP


 * TYPE :CHAR


 * ECHO.CHARS

END