LOTUSSCRIPT LANGUAGE


Print statement
Example

Prints data to the screen.

Syntax

Print [ exprList ]

Elements

exprList


Usage

If exprList is omitted, Print prints a blank line.

Use the Spc and Tab functions to insert spaces and tabs between data items.

The Print statement adds a newline character to the end of exprList (to force a carriage return), unless exprList ends with a semicolon or a comma.

LotusScript inserts "chr(10)" to represent the newline character in any multiline string (for example, a string that you type in using vertical bars or braces). If you use Print to print the string, this newline character will be translated into the platform-specific newline character(s).

Note Newline does not mean either chr(10) or chr(13) on all platforms. Newline is the character or sequence of characters that is used to mark the end of a line. This may be chr(10), or chr(13), but it may also be something else, because the actual value of newline depends on the platform.

The following table shows how the Print statement handles data items specified in exprList.

Data itemPrint statement behavior
variablePrints the value of the variable.
stringPrints the string.
date/time valuePrints the date as a string in the operating system Short Date and Time format. If either the date part or the time part is missing from the value, only the supplied part is printed.
Variant with the value EMPTYPrints an empty string ("").
Variant with the value NullPrints the string "#NULL#".
The following table shows the effect of semicolons and commas in the Print statement.

Punctuation characterPrint statement behavior
Semicolon or space in exprListThe next data item is printed with no spaces between it and the previous data item.
Semicolon at end of exprListThe next Print statement continues printing on the same line, with no spaces or carriage returns inserted.
Comma in exprListThe next data item is printed beginning at the next tab stop. (Tab stops are at every 14 characters.)
Comma at end of exprListThe next Print statement continues printing on the same line, beginning at the next tab stop. (Tab stops are at every 14 characters.)
If you are in Lotus Notes, note that the Print statement writes to the following: If the request is from the Web, Print will be re-directed to the source

Example
See Also