Download Print this page

Commodore 64 User Manual page 57

Hide thumbs Also See for COMMODORE 64:

Advertisement

~
In computer language, commas are used to
separate each new item that your computer is
supposed to check out before executing the
command you have given it. The comma is
used in such commands as:
LOAD" S",8
OPEN 1,8,15
Do not type these commands now.
In these examples, you want your VIC or 64
to look at several pieces of information. The
first comma tells your computer where to look;
8 stands for the disk drive on all Commodore
computers. The second and later commas mark
off additional information needed by your
computer system to complete this command.
Remember the program in which you recently
used the semicolon?
100 FOR I = I TO 400
110
:
PRINT I;
120 NEXT
To display this program on the screen again,
type the word LIST and press RETURN. Again,
unless you turned the computer off, the pro
gram will redisplay. If you did turn off your
computer, type this program again, making
sure to press RETURN after each line.
Now move the cursor back up to line 110,
and replace the semicolon with a comma
SCREEN I
Now press the RETURN key (to tell the com
puter to remember the new version, not the
old one). Then, move the cursor below the last
program line, type RUN, and press RETURN.
Watch as your VIC or 64 prints the numbers
again.
SCREEN 2
Notice that they are spread out into columns
this time. When a comma follows a BASIC
command, it tells your computer to execute
the next command line in the next tabbed col
umn (every I Oth column) on your computer.
On the 64, that makes the print statements
appear in columns 0, 10, 20, and 30. On the
VIC, you only have columns 0, 10, and 20. If a
command takes more than 10 horizontal
spaces, the program will skip to the next
tabbed column.
Before going on to the next exercise, clear
the screen by holding down a SHIFT key and
pressing the CLR/HOME key.
K- IS T
isa
for
i=i
to
til
f*R int i .a
130
NEXT
READV.
SCREEN 1
Change the semicolon In your program to
a comma and see what happens-
-:i; .2.
-.-
365
367
3 ■-:- 3
1
37 1
1 373
37§
37 V
373
381
1
333
I 385
1
3 S 7
'
3-3 3
p
33 1
39i
395
;
337
1
333
362
364
3 S S
? 6 S3
-: 7 0
372
38i
|SS
is -;
3S6
;::-::;-:
.-■ 9 3
.-1: 9 .=■
3 ■£■' :3
480
SCREEN 2
The comma places the numbers In columns
(In two columns on the VIC).
55

Advertisement

loading

Related Products for Commodore COMMODORE 64

This manual is also suitable for:

Vic 20