PRINT

Synopsis
PRINT thing
PR thing
(PRINT thing1 thing2 ...)
(PR thing1 thing2 ...)
Description

Prints the input or inputs to the current write stream (initially the Commander History/Output box). All the inputs are printed on a single line, separated by spaces, ending with a newline. If an input is a list, square brackets are not printed around it, but brackets are printed around sublists. Braces are always printed around arrays but an array's origin is not displayed.

PRINT formats its input (or inputs) to be read by a user and so does not include some technical aspects of a variable's construction, such as an array's origin or a word's vertical bars or backslashes.

If the current write stream is a file that was opened as a text file (that is, not opened in binary mode), then PRINT writes each newline character as the Windows end-of-line sequence: a carriage return followed by a newline character.

If the current write stream is a file that was opened in binary mode, then only the lower byte of each character is printed. Furthermore, a newline character is printed simply as a newline character.

Examples
PRINT "Hello
Hello
PRINT [Hello, how are you?]
Hello, how are you?

The following examples show the difference between how PRINT and PO display variables.

MAKE "array {1 2 3}@0
PRINT :array
{1 2 3}

PO [[] [array]]
Make "array {1 2 3}@0
MAKE "word "|A word with vertical bars.|
PRINT :word
A word with vertical bars.

PO [[] [word]]
Make "word "|A word with vertical bars.|
See Also
PRINTDEPTHLIMIT
PRINTWIDTHLIMIT

SourceForge.net Logo