User Tools

Site Tools

Translations of this page:

ugBASIC User Manual



   PRINT [expr] [; [expr] [; ...] ... ]
   PRINT [expr] [, [expr] [, ...] ... ]
   PRINT @expr, [, [expr] [, ...] ... ]


The PRINT instruction displays information on the screen, starting from the current cursor position. An item or a list of items can follow the command. If any item is omitted, a blank line is printed. The list of items can consist of any group of strings, variables or constants. Each element in the list must be separated by either a semi-colon ; or a comma ,. A semi-colon prints the data immediately after the previous value, whereas a comma first moves the cursor to the next TAB position on the screen.

Normally the cursor will be advanced downwards by a single line after each PRINT instruction. This can be suppressed by adding a separator after the print. As before, a semicolon will preserve the cursor position after the operation, and a comma will place the cursor to the next TAB stop before proceeding.

All data printed to the screen is formatted by using the specific formatter for numbers, and “as is” for strings, while complex data will be printed out with an unique decription string. For the numeric data, the numbers are always translated into decimal system. Nothing is written if parameter is omitted.

Because the PRINT instruction prints with mono-spaced characters, there is a correlation between the number of characters printed and the number of columns those characters occupy. This ensures that each character uses only one column.

It is also possible to put the output to a specific location. The PRINT @ command is used to place output at a specified place on the screen. For this purpose the screen is divided into a SCREEN COLUMNS x SCREEN ROWS grid, giving a certain amount of positions. The expression after the @ can be a number, a variable or an arithmetic expression, as long as the value is between 0 and ((SCREEN COLUMNS*SCREEN ROWS)-1).


  PRINT (a + b);" IS A SUM!";

See also the following example files:




  • Atari (400/800)
  • Atari XL/XE
  • Commodore 128 (MOS 8502)
  • Commodore 128 (Zilog Z80)
  • Commodore 64
  • Commodore 64+REU
  • TRS-80 Color Computer
  • TRS-80 Color Computer 3
  • ColecoVision
  • Amstrad CPC 664
  • Dragon 32
  • Dragon 64
  • Thomson MO5
  • Thomson MO5
  • Olivetti Prodest PC128
  • Commodore PLUS/4
  • SEGA SC-3000
  • SEGA SG-1000
  • VG-5000
  • Commodore VIC-20
  • ZX Spectrum 48


If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!