EasyManua.ls Logo

Commodore Plus 4 - Page 15

Commodore Plus 4
464 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...
The
Elements
of
BASIC
3
Data
T^ypes
Floating-point
numbers
can
be
any
type
of
number,
whole
or
decimal
(decimal
numbers
are
also
called
real
numbers),
between
2.93873588E-39
and
1.70141183E+38,
the
negatives
of
those
numbers,
or
zero.
Floating-point
numbers
are
stored
in
RAM
using
a
5-byte
binary
format.
Integer
numbers
can
be
any
whole
number
between
-32767
and
32767.
(Note
that
you
can
use
larger
and
smaller
values
for
floating-point
numbers.)
Numbers
with
decimal
parts
are
not
accepted;
they
are
truncated
and
ignored
by
BASIC.
Integer
numbers
are
stored
in
RAM
in
a
5-byte
binary
format.
Numbers
in
integer
arrays
are
stored
as
2-byte
binary
numbers.
Character
strings,
or
text
strings,
can
be
any
characters
in
quotes,
including
numbers,
blank
spaces,
and
special
symbols.
The
only
keyboard
character
that
cannot
be
directly
included
in
a
character
string
is
a
quotation
mark.
This
is
impossible
because
a
quotation
mark
is
used
to
begin
and
end
strings.
If
you
try
to
type
a
quotation
mark
in
a
string,
BASIC
assumes
the
quotation
mark
signifies
the
end
of
the
string;
any
additional characters
are
assumed
to
be
a
variable
name.
For
example,
the
command
PRINT
"HELLO"
MOM
prints
HELLO
0.
BASIC
prints
the
0
as
the
value
for
what
it
assumes
is
the
variable
MOM.
However,
a
quotation
mark
may
be
used
in
a
string
with
the
help
of
the
CHR$
function.
Note
that
a
number
in
quotation
marks
is
treated
like
any
text
and
has
no
mathematical
value.
BASIC
discriminates
between
these three
data
types
in
variable
form
by
the
way
you
name
the
variable.
The
three
variable
types
are
shown
in
Table
1-1
with
the
symbols
used
to
distinguish
them.
Floating-point
variables
can
stand
for
any
type
of
number,
whole
or decimal,
between
2.93873588E-39
and
1.70141183E+38,
the
negatives
of
those
numbers,
or
zero.
Integer
variables
can
stand
for
any
whole
number
between
-32767
and
32767.
(Note
that
you
can
use
larger
and
smaller
numbers
for
floating-point
variables.)
Numbers
with
decimal
parts
are
not
accepted.
If
you
assign
a
decimal
number
to
an
integer
variable,
the
decimal
part
of
the
number
is
ignored.
For
Table
1-1.
BASIC
Variable
Types
Floatingpoint
Integer
Character
String
Symbol
None
%
$
Meaning
Decimal
or
Whole
numbers
Characters
whole
numbers
only
in
quotes
Examples
X,
X5,
RX
X%,
X5%,
AGE%
S$,
R5$,
NAMES

Other manuals for Commodore Plus 4

Related product manuals