EasyManua.ls Logo

Commodore VIC-20 - Page 54

Commodore VIC-20
404 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
40
The
VIC
20
User
Guide
If
you get a
syntax
error
message, check
your
statement
for
typographical errors.
Immediate mode does what its name implies: Any statements you enter
will
execute immediately after you press RETURN.
The
PRINT
statement
is
the most frequently used immediate mode
statement.
PRINT
instructs the VIC to display whatever follows it.
For
example,
PRINT
will display the results
of
calculations such as
PRINT
360+199+1000
which, in this case, would be
1559.
PRINT
will also display characters
or
entire strings of characters. A
string
is
a sequence of characters that can include letters, numbers, spaces,
and symbols. To display a string such as
AND
MILES
TO
GO
BEFORE
I
SLEEP
on the VIC's screen, you would type the following immediate mode state-
ment and press
RETURN:
PRINT"AND
MILES
TO
GO
BEFORE
I
SLEEP"
The string has quotation marks around it; anything enclosed in quotation
marks in a
PRINT
statement will display literally as a string of characters.
For
example, a
PRINT
statement such as
PRINT"360+199+1000"
will not calculate anything. The computer will display a string of characters,
which in this case
is
three numbers connected by plus signs. Conversely, the
statement
PRINT
AND
MILES
TO
00
BEFORE
I
SLEEP
will not display anything except a syntax error message. The syntax of a
PRINT
statement always expects numeric
or
string information to follow.
The word AND does not represent a number and
is
not in quotes; therefore,
the VIC rejects the statement.
You can abbreviate
PRINT
by using a question mark. The following
statements produce the same result:
PRINT"OODFREY
CAMBIIII:
I
DOe:
"

Other manuals for Commodore VIC-20

Related product manuals