Commodore 64 User Manual page 48

Hide thumbs Also See for 64:
Table of Contents

Advertisement

NEW
1 0CT=0
20 ?"COMMODORE 64"
:30 CT = CT + 1
40 IF CT c_ 5 THEN 20
50 END
RUN
COMMODORE 64
COMMODORE 64
COMMODORE 64
COMMODORE 64
COMMODORE 64
What we've done is introduce two new BASIC commands, and pro-
vided some control over our runaway little print program introduced at
the start of this chapter.
IF . . . THEN adds some logic to the program. It says IF a condition
holds true THEN do something. IF the condition no longer holds true,
THEN do the next line in the program.
A number of conditions can be set up in using an IF . . . THEN state-
ment:
SYMBOL MEANING
< Less Than
> Greater Than
<>
Equal To
Not Equal To
Greater Than or Equal
or Equal To
To
< = Less Than
The use of any one of these
powerful.
10 CT = 0
20 ?"COMMODORE 64"
30 CT = CT + 1
40 IF CT < 5 THEN 20
I
50 END
conditions is simple , yet surprisingly
38

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents