print Statement

The print statement directs output of an expression to the current output device.

Syntax

print {exp {,}{:}}{exp{,}{:}...}

Parameter(s)

exp

Expression whose output is sent to the printer. Multiple expressions can be specified.

,

Defines 18-character tab stops at which comma-separated expressions are output left-aligned.

NOTE: Use of @() cursor positioning in conjunction with this feature produces undesirable results.

:

Inhibits the output of a return and scroll following output of the last printed line.

Description

If nothing follows the print statement, a blank line is output.

The print list, if present, consists of any number of expressions, including @() functions, separated by commas or colons.

Example(s)

This statement outputs the literal string hello. The quotation marks delimit the literal string and are not printed.

print ’hello’

This statement outputs the contents of the variable message to the current active output device.

message = ’hello’

print message

This statement outputs the results of a string expression made up of the variables message and company.name and the literal string space (" ").

print message:’ ’:company.name

This statement positions the cursor at column 10, row 10 of the terminal display, displays the literal string the amount is, and outputs the result of the arithmetic expression unit.price * qty right-aligned in a field of 12 characters.

print @(10,10):’the amount is ’ : (unit.price * qty) ’r#12’

See Also

, Reserved Character, : Relational Operator, @() Function, cat Relational Operator, char() Function, crt Statement, Masking, print on Statement, printer Statement, Statements and Functions