Print
 
Writes text to the screen

Syntax

Print [ expressionlist ] [ , | ; ]

Parameters

expressionlist
list of items to print

Description

Print outputs a list of values to the screen. Numeric values are converted to their string representation, with left padding for the sign. Objects of user-defined types must overload Operator Cast () As String.

Consecutive values in the expression list are separated either by a comma (,) or semicolon (;). A comma indicates printing should take place at the next 14 column boundary, while a semicolon indicates values are printed with no space between them.

A new-line character is printed after the values in the expression list unless the expression list is followed by a comma or semicolon.

For more control over character style and text position in graphics modes, consider using Draw String.

Example

'' new-line
Print "Hello World!"

'' no new-line
Print "Hello"; "World"; "!";
Print

'' column separator
Print "Hello!", "World!"


Dialect Differences

  • In the -lang qb dialect, an extra space is printed after numbers.

Differences from QB

  • None, when using QBASIC's variable types in -lang qb.
  • Unsigned numbers are printed without a space before them.
  • QB did not support casting for UDTs, so didn't allow them to be Printed.

See also