Shows the content of a literal string or a string variable on screen by default, or to a file or output device specified by optional arguments.
Implemented by: dartmouth4, ansimin, ansifull, decbasic, Altair, a2int, Applesoft, TI994, CBM, Atari, msatari, Sinclair, GWBASIC, MSX, bwbasic, bw32, msamiga, QBasic, VBDOS, FreeBASIC, Gambas, ugBASIC, minibasicmm, minibasicjs, EndBASIC
With variations: dartmouth1 (no semicolon for line continuation), dartmouth2 (semicolon advanced to the next multiple of 3 column), hptsb, Simons1, trs80 (introduced PRINT AT), level2 (also PRINT@), trsdisk (with # for writing to file), level3 (the PRINT#-3 variation), trscolor (also PRINT @, linear location), colormc, spectrum, Atom, BBC (also as PRINT#), ABasiC
Also written as:
Usage
PRINT has some punctuation formatting available since its begginings:
- When the string to be printed has nothing after it, a new line is automatically inserted.
- When the string(s) to be printed are separated or followed by comma, a tabulation is inserted instead of a new line. The tab size is machine dependent.
- When the string(s) to be printed are separated or followed by semicolon, nothing is inserted and the following string or PRINT will happen right after.
- Exception: positive numbers have a space printed before them because of an "invisible" sign.1)
Variations
Examples
The canonical and most famous first example of every programming language:
10 PRINT "HELLO"