PEEKBYTE

Syntax

PEEKBYTE

Explanation

PEEKBYTE outputs the ASCII value of the next character waiting on the input stream. The character is left in the input stream for subsequent READ, READCHAR, READLINE, READLIST, READQUOTE, or other input primitives.

Example

The following procedure prints the text of a file in Logo without loading file into workspace.

TO TYPE.FILE :FILE

LOCAL "CHANNEL

MAKE "CHANNEL OPEN :FILE

IF :CHANNEL = "FALSE (PR :FILE [NOT FOUND.]) STOP

MAKE "STANDARD.INPUT :CHANNEL

NOCASE

WHILE [NOT PEEKBYTE = :EOF] [PRINT READQUOTE] CASE

CLOSE "STANDARD.INPUT

MAKE "STANDARD.INPUT 0

END