print

Description

The print procedure writes one or more expressions to the user’s terminal as a single line. The line terminates with a newline character. A comma separates each argument. If an integer is supplied as an argument, then its value is automatically converted to a character string. If a list is supplied, then it prints as a series of quoted strings with the entire series between braces.

The print and printnnl procedures work in the same manner. The only difference is that print terminates the generated character string with a newline character, whereas printnnl does not.

Syntax

print (expression1 [, expression2, …]);

Arguments

expression1 Required. A value that is displayed to the user.
expression2, … Optional. Additional values that are displayed to the user.

Return Values

Because print is a procedure, no return value is set.

Example

In the first example,

print ("Your task request has been accepted.", "Thank you.");

writes the following to the user's terminal:

Your task request has been accepted. Thank you.

This line terminates with a newline character.

The second example,

TrustedUsers = {"JWhite", "TBrown", "SBlack"};
print ("The trusted users are:", TrustedUsers);

writes the following on the user’s terminal:

The trusted users are: {"JWhite", "TBrown", "SBlack"}

This line terminates with a newline character.

See Also

fprintf, outputredirect, printf, printnnl, sprintf(), syslog