PRINT

From C64-Wiki

Jump to: navigation, search
BASIC keyword
Keyword:PRINT
Abbreviation:?
Type:Command
Token code:153/$99
Handling routine
in BASIC ROM:
43680–43751
$AAA0–AAE7
List of all BASIC keywords


Remark: This article describes the BASIC-Command PRINT in BASIC V2 at the Commodore 64.

Typ: Command
General Programming-Syntax: PRINT <Variable> [<, or ;><Variable>...]

The BASIC-Command PRINT is used for output datas on screen. Alternative for variable (strings, integrer or floating point) can be used any technical terms or BASIC-Functions. It is important to set strings, graphics and control chars into quotes (" "). When this isn't observed the BASIC-Errormessage "?SYNTAX ERROR IN line" occoured.

  • Text (strings) without quotes will be interpreted as variables for numbers.
  • A PRINT-Command without any data will be getting a empty line
  • After setting a semicolon (;), the next PRINT-Command is printing directly after the last PRINT-Command. But it exists two exception: First by using numeric terms (functions or integer and floatoing point variables) apperead a space. Second by positive number-terms apperead a space before the number.
  • A logical line of the screen at the C64 has got eight blocks with 10 chars. By using a comma (,) can be using the next block.
  • Using a comma (,) or semicolon (;) isn't need for separating variables or datas. The BASIC-Interpreter is tolerant by missing this chars. But spaces without quotes (" ") are ingnored, so that variables with numbers are separating with commas.

Remark: The BASIC-Command CMD can redirected the listing with PRINT on another device like a printer or diskdrive.

[edit] Examples

PRINT 12+2
PRINT 12-1
PRINT 12*2
PRINT 12/2
PRINT COS(2)

You can calculated directly.

PRINT A B C: PRINT " is not the same as ": PRINT A,B,C

Because in the first PRINT is used the variable ABC.

10 A$="Hallo ": 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$
BASIC V2.0-Commands of Commodore 64

ABS | AND | ASC | ATN | CHR$ | CLOSE | CLR | CMD | CONT | COS | DATA | DEF | DIM | END | EXP | FN | FOR | FRE | GET | GET# | GOSUB | GOTO | IF | INPUT | INPUT# | INT | LEFT$ | LEN | LET | LIST | LOAD | LOG | MID$ | NEW | NEXT | NOT | ON | OPEN | OR | PEEK | POKE | POS | PRINT | PRINT# | READ | REM | RESTORE | RETURN | RIGHT$ | RND | RUN | SAVE | SGN | SIN | SPC( | SQR | STATUS/ST | STEP | STOP | STR$ | SYS | TAB( | TAN | THEN | TIME/TI | TIME$/TI$ | TO | USR | VAL | VERIFY | WAIT

 
Personal tools
Help and Feedback
In other languages