EasyManua.ls Logo

Commodore 64 - Converting Standard Basic Programs to Commodore 64 Basic; String Dimensions; Multiple Assignments

Commodore 64
176 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...
APPENDIX K
CONVERTING STANDARD
BASIC PROGRAMS TO
COMMODORE 64 BASIC
If. you have programs written in a BASIC other than Commodore
BASIC, some minor adjustments may be necessary before running them
on the Commodore-64. We've included some hints to make the conver-
sion easier.
String Dimensions
Delete all statements that are used to declare the length of strings. A
statement such as DIM A$(I,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.
Each of these must be changed to a plus sign, which is the Commodore
BASIC operator for string concatenation.
In Commodore-64 BASIC, the MID$, RIGHT$, and LEFT$functions are
used to take substrings of strings. Forms such as A$(I) to access the Ith
character in A$, or A$(I,J) to take a substring of A$ from position I to J,
must be changed as follows:
Other BASIC
A$(I)
= X$
A$(I,J) = X$
Commodore 64 BASIC
A$ = LEFT$(A$,I-1)+X$+MID$(A$,I+1)
A$ = LEFT$(A$,I-1)+ X$+MID$(A$,J+ 1)
Multiple Assignments
To set Band C equal to zero, some BASICs allow statements of the
form:
19) LET B=C=9)
148

Table of Contents

Other manuals for Commodore 64

Related product manuals