EasyManua.ls Logo

Commodore 128D - Page 343

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...
Variables
The
Commodore
128
uses
three
types
of
variables
in
BASIC.
These
are:
normal
numeric,
integer
numeric
and
string
(alphanumeric).
Normal
NUMERIC
VARIABLES,
also
called
floating
point
variables,
can
have
any
value
from
**superscript**
-
10
to
^super
script*
*
+10,
with
up
to
nine
digits
of
accuracy.
When
a
number
becomes
larger
than
nine
digits
can
show,
as
in
+
10
or
-
10,
the
computer
displays
it
in
scientific
notation
form,
with
the
number
nor
malized
to
one
digit
and
eight
decimal
places,
followed
by
the
letter
E
and
the
power
of
10
by
which
the
number
is
multiplied.
For
example,
the
number
12345678901
is
displayed
as
1.23456789E
+10.
INTEGER
VARIABLES
can
be
used
when
the
number
is
from
+
32767
to
-
32768,
and
with
no
fractional
portion.
An
integer
varia
ble
is
a
number
like
5,10
or
-100.
Integers
take
up
less
space
than
floating
point
variables,
particularly
when
used
in
an
array.
STRING
VARIABLES
are
those
used
for
character
data,
which
may
contain
numbers,
letters
and
any
other
characters
the
Commodore
128
can
display.
An
example
of
a
string
variable
is
"Commodore
128."
VARIABLE
NAMES
may
conaist
of
a
single
letter,
a
letter
followed
by
a
number
or
two
letters.
Variable
names
may
be
longer
than
two
characters,
but
only
the
first
two
are
significant.
An
integer
is
speci
fied
by
using
the
percent
sign
(%)
after
the
variable
name.
String
variables
have
a
dollar
sign
($)
after
their
names.
EXAMPLES:
Numeric
Variable
Names:
A,
A5,
BZ
Integer
Variable
Names:
A%,
A5%,
BZ%
String
Variable
Names:
A$,
A5$,
BZ$
ARRAYS
are
lists
of
variables
with
the
same
name,
using
an
extra
number
(or
numbers)
to
specify
an
element
of
the
array.
Arrays
are
defined
using
the
DIM
statement
and
may
be
floating
point,
integer
or
string
variable
arrays.
The
array
variable
name
is
followed
by
a
set
of
parentheses
()
enclosing the
number
of
the
variable
in
the
list.
EXAMPLE:
A(7),
BZ%(11),
A$(87)
Arrays
can
have
more
than
one
dimension.
A
two-dimensional
array
may
be
viewed
as
having
rows
and
columns,
with
the
first
number
identifying
the
row
and
the
second
number
identifying
the
column
(as
if
specifying
a
certain
grid
on
a
map).
335
BASIC
7.0
ENCYCLOPEDIA—Variables
and
Operators

Table of Contents

Other manuals for Commodore 128D

Related product manuals