Differences

This shows you the differences between two versions of the page.


Previous revision
print [2026/09/18 16:22] (current) – [Examples] jjflash
Line 1: Line 1:
 +====== PRINT ======
  
 +[pet] [vic20] [c64] [c16] [cplus4] [c128] [x16] [m65]
 +
 +Output strings and numbers on the currently selected screen, at the current cursor position.
 +
 +===== Syntax =====
 +
 +<code xcbasic>
 +PRINT <expression> [ ,|; <expression>] ... [;]
 +</code>
 +  
 +Expressions can be of any type, excluding user-defined types. Expressions are separated with commas ('','') or semicolons ('';'').
 +
 +  * If the separator is a comma, the cursor will be moved to the next tab position. A tab is 10 characters wide.
 +  * If the separator is a semicolon, the cursor will not be moved.
 +
 +A semicolon at the end of the statement will prevent printing a newline after the last printed expression.
 +===== Examples =====
 +
 +<code xcbasic>
 +PRINT "hello world"
 +PRINT "the value of myvar is "; myvar; " and that of anothervar is "; anothervar
 +' -- tabular output
 +a = 10 : b = 20 : c = 30
 +PRINT a, b, c
 +</code>