[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applesoft <-> text basic



In article <"93-11-29-21:19:29.79*SPA"@NCCIBM1.BITNET>, SPA@NCCIBM1.BITNET
(Jim Spath 410-631-3318, MD Dept of Environment.2500 Broening Hwy.Balt MD
21224-6612) wrote:
> 
> I dug up some old Microsoft BASIC programs to show my soon-to-be
> 5 year-old some simple arithmetic/computer tricks, and was
> wondering how to load them into Applesoft on my //e.  I get a
> message that says "FILE TYPE MISMATCH," after transferring the
> ASCII-saved code from (shudder) CP/M origins to PRODOS.  Any
> hints or suggestions?  <SPA@NCCIBM1.BITNET> /jim spath

The problem here is that the programs were originally under CP/M.

When you saved the files, are you sure you saved them as text?  If, the
original program was saved as a tokenized file under CP/M and then you
saved to the same file name as a text file, then sometimes MBASIC (or
GBASIC or CBASIC or whichever one you used) will abort without telling
you it aborted OR it will save as a tokenized file even though you
told it to do otherwise.

Then there is the question of how you transferred the program from
CP/M to ProDOS (or DOS 3.3).  If you do not have it, you should get
Chameleon.  It will transfer the files for you without any kind of
problem.

So let's say you get past the two things above and you have an
actual text file.  Under DOS 3.3 (and I believe Applesoft under
ProDOS allows for this as well), you would type:

   EXEC <Filename>

to get the program back into memory.  Unfortunately, this is only
the start of your problems.  Unless the program is very generic,
you will find that the commands under CP/M's basic will not work
under Applesoft.  Now, this is not to say that commands such as
IF-THEN won't work, but it does mean that the IF-THEN-ELSE won't
work.  LOCATE doesn't work, the graphic commands won't work, and
other things won't work.  But so long as you stick with the basic
BASIC commands you should be ok. :)

If, when you do the EXEC command, you get errors, then your best
bet is to use a text editor program and look at the file.  You
should be able to detect where there are strange control characters
within the file and remove them.  Or, on the other hand, you might
wind up writing a small BASIC program to convert the file to a
more standard text file.  Such as:

10 ?"^Dopen myfile"
20 ?"^Dread myfile"
30 ?"^Dopen newfile"
40 ?"^Dwrite newfile"
50 ?"^Dread myfile"
60 onerr goto 150
70 a$=""
80 get b$
90 if asc(b$)>127 then b$=chr$(asc(b$)-128)
100 if b$<" " and b$<>chr$(13) then b$=" "
110 if b$<>chr$(13) then a$=a$+b$:goto 80
120 ?"^Dwrite newfile"
130 ? a$
140 goto 50
150 ?"^Dclose"
160 poke 216,0
170 ?"Finished."
180 end

This little program should remove any weird characters your file
has and make it usuable by Applesoft via the EXEC command.

Later.

----------------------------------------------------------------------------
I saw a mountain rising.  Rising above the sea.  I heard the wind calling. 
Calling unto me.  Oh, who has seen the sunset?  Who has seen it rise?  Who
could ever be so blind?  As to never open their eyes? - Mark Manning

mark@trillian.jsc.nasa.gov