EasyManua.ls Logo

Commodore Plus 4 - Page 181

Commodore Plus 4
234 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...
SECTION
3
Converting
Standard
BASIC
Programs
To
Commodore
BASIC
3.5
Conversion
Programs
If
you
have
programs
written
in
a
BASIC
other
than
Commodore
BASIC,
some
minor
adjustments
may
be
necessary
before
running
them
on
the
Plus/4.
Here
are
some
hints
to
make
the
conversions
easier.
String
Dimensions
Delete
all
statements
that
are
used
to
declare
the
length
of
strings.
A
statement
such
as
DIM
A$(l,J),
which
DIMensions
a
string
array
for
J
elements
of
length
I,
should
be
converted
to
the
Commodore
BASIC
statement
DIM
A${J).
Some
BASICS
use
a
comma
or
ampersand
for
string
concatenation
(linking).
Each
of
these
must
bexhanged
to
a
+
sign,
which
is
the
Commodore
BASIC
3.5
operator
for
string
concatenation.
In
Commodore
BASIC,
the
MIDS.
RIGHTS,
and
LEFTS
functions
are
used
to
lake substrings
of strings.
Forms
such
as
A$(l)
to
access
the
Ith
character
in
AS,
or
AS(I.J)
to
take
a
substring
of
AS
from
position
I
to
J,
must be
changed
as
follows:
Other
BASIC
A$(l)
-
XS
AS(I.J)
=
XS
Commodore
BASIC
3.5
MIDS(AS,I.J)
=
X$
MID$(A$,I,J)
=
X$
Multiple
Assignments
To
set
B
and
C
equal
to
zero,
some
BASICs
allow
statements
of
the
form:
10
LET
B-
C
=0
Commodore
BASIC
would
interpret
the
second
sign
as a
logical
operator
and
set
B
=
-1
if
C
=
0.
Instead,
convert
this
statement
to:
10C
=
0
B =
0
Multiple
Statements
Some
BASICs
use
a
backslash
(/)
to
separate
multiple
statements
on
a
line.
With
3.5
BASIC,
use
a
colon
(:)
to
separate
all
statements.
Mat
Functions
Programs
using
the
MAT
functions
available
on
some
BASICs
must be
rewritten
using
FOR..
.NEXT
loops
to
execute
properly.
172

Other manuals for Commodore Plus 4

Related product manuals