in BASIC ROM:
|List of all BASIC keywords|
Typ: Command General Programming-Syntax: PRINT <Variable> [<, or ;><Variable>...]
The BASIC command PRINT is used to print data onto the screen. In place of variables (strings, integers or floating point), any mathematical term or BASIC function can be used. It is important to put strings, graphic and control chars between quotes (" "). When this isn't observed the BASIC error message
"?SYNTAX ERROR IN line" is returned.
- Text (strings) without quotes will be interpreted as variable names.
- A PRINT command without any data prints an empty line
- To suppress printing of new lines, append a semicolon (;). The next PRINT command is printed directly after the last PRINT command. There are two exceptions: First, when using numeric terms (functions or integer and floating point variables) a space character is printed after the number. Second, in front of positive numbers a space character is printed.
- A logical line on the screen of the C64 has a length of eighty characters. By using a comma (,), the subsequent output is printed at the next tabulator margin, which is 10 characters wide.
- It is not necessary to separate variables or data by comma (,) or semicolon. The BASIC interpreter tolerates the omission of these characters. Spaces without quotes (" ") are ignored, so numerical variables need to be separated by comma or semicolon.
- There is a bug with this command on the C128, where typing PRINT ""+-1 4 times will crash the system, with weird text displayed.
PRINT 12+2 PRINT 12-1 PRINT 12*2 PRINT 12/2 PRINT COS(2)
You can calculate directly.
PRINT A B C: PRINT " is not the same as ": PRINT A,B,C
Because in the first case, A B C is interpreted as the variable name ABC.
10 A$="Hello ": B$="What is your name": D$="C64" 20 PRINT A$"? "B$; :INPUT C$ 30 PRINT: PRINT, :PRINT A$C$ 40 PRINT: PRINT "My name is ";D$