EasyManua.ls Logo

Commodore 128D - Using the Question Mark to Abbreviate the PRINT Command; Printing Text

Commodore 128D
427 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...
separated
by
a
comma.
If
you
don't
want
all
the
extra
spaces,
use a
semicolon
(;)
in
your
PRINT
statement
instead
of
a
comma.
The
semi
colon
tells
the
computer
not
to
add
any
spaces
between
strings
and
numeric
variables
and
numeric
constants.
Numbers
and
numeric
variables
are
printed
with
either
a
leading
space
or
a
minus
sign,
and
a
trailing
space.
Omitting
a
semicolon,
a
comma,
or
any
separators
acts
the
same
as
a
semi-colon.
Type
these
examples
and
see
what
happens:
PRINT
100;200;300;400;500
111-M
HIM
Using
the
Question
Mark
to
Abbreviate
the
PRINT
Command
You
can
use
a
question
mark
(?)
as
an
abbreviation
for
the
PRINT
command.
Many
of
the
examples
in
this
section
use
the
?
symbol
in
place
of
the
word
PRINT.
In
fact,
most
of
the
BASIC
commands
can
be
abbreviated.
However,
when
you
LIST
a
program,
the
keyword
appears
in
the
long
version.
The
abbreviations
for
BASIC
commands
can
be
found
in
Appendix
K
of
this
Guide.
Printing
Text
Now
that
you
know
how
to
print
numbers,
it's
time
to
learn
how
to
print
text.
It's
actually
very
simple.
Any
words
or
characters
you
want
to
display
are
typed
on
the
screen,
with
a
quote
symbol
at
each
end
of
the
string
of
characters.
String
is
the
BASIC
name
for
any
set of
characters
surrounded
by
quotes.
The
quote
character
is
obtained
by
pressing
SHIFT
and
the
numeral
2
key
on
the
top
row
of
the
key
board
(not
the
2
in
the
numeric
keypad).
Try
these
examples:
?
"COMMODORE
128"
SEUSE
9
"4*5"
nFTIinM
Notice
that
when
you
press
RETURN,
the
computer
displays
the
characters
within
the
quotes
on
the
screen.
Also
note
that
the
sec
ond
example
did
not
calculate
4*5
since
it
was
treated
as
a
string
and
not
a
mathematical
calculation.
If
you
want
to
calculate
the
result
4*5,
use
the
following
command:
You
can
PRINT
any
string
you
want
by
using
the
PRINT
command
and
surrounding
the
printed
characters
with
quotes.
You
can
com
bine
text
and
calculations
in
a
single
PRINT
command
like
this:
?"4*5=
"4*5!
29
USING
C128
MODE—Getting
Started
in
BASIC

Table of Contents

Other manuals for Commodore 128D

Related product manuals