The print statement directs output of an expression to the current output device.
print {exp{,}{:}}{exp{,}{:}...}
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. |
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.
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’