PRINT [expressionlist] [(, | ;)] ...

Prints expressionlist to screen.

Expressionlist can be constant string, constant numbers, variables, string variables or expressions consisting of variables and numbers.  Separated by either , or ;

Using a comma (,) as separator or in the end of the expressionlist will place the cursor in the next column (every 5 characters), using a semi-colon (;) won't move the cursor. If neither of them are used in the end of the expressionlist, then a new-line will be printed.

PRINT statements send data out the serial port.  There is a 256 byte FIFO in the UART driver, once that is filled BASIC will wait for space to be available.  PRINT requires interrupts to be enabled (the default case) as this buffer is emptied on the TX register available interrupt.

expressionlist will be evaluated as INTEGER or SINGLE depending on the type of the first variable or constant in each expression.

INTEGER expressions will display as -2147483648 to 2147483647

SINGLE expressions will display 0.0 and the range from 0.100000 through 9999999. and the corresponding negative range.  Numbers outside that range will display as 1.000000E-39 to 9.999999E+38.   Numbers out of range of valid values will display as Inf (infinity) or Nan (not a number).   Numbers are also rounded before printing to the 7th significant digit.


'' new-line"Hello World!"'' no new-line
PRINT "Hello";AB; "!";

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

PRINT "3+4 =",3+4

PRINT "sum=",x+y 
Differences from other BASICs

See also

  • DEBUGIN the opposite function that receives user input