The QBASIC section has been archived, and is no longer updated.

Print

The PRINT command outputs text to the screen or a file. It looks like this:

PRINT [#filenumber] [text[,|;] [text[,|;] ...]

For more on making PRINT print to a file, see File I/O. See also PRINT USING.

PRINT can be used alone to print a blank line to the screen.

text is some text to display. It can be a variable or a string. It is followed by a comma or semicolon. A comma (,) causes a tab, so that the next text to be printed will appear on the same line, but at the next tab stop. A semicolon (;) causes the next PRINT statement to appear right next to the text from the last one, on the same line. At the end of the PRINT statement, you can leave off the comma or semicolon to make the next PRINT statement print on the next line down.