[comp.sys.cbm] How to convert text files to BASIC executables?

csr@drutx.ATT.COM (cd) (04/04/88)

  Is there some way on a C64 to convert a text file to a loadable BASIC
file.  Two examples of why I need to do this are:
  - I have a "listing" on diskette, but not the executable
  - I want one BASIC program to write another BASIC program
I readily admit ignorance about the C64, but can't find anything in the
documentation about how to do what i want.

Thanks

steve roush
AT&T
303-538-4860
ihnp4!drutx!csr 

p.s.
I want to do this for a class I am teaching to Jr & Sr High School kids
about programming.

mat@emcard.UUCP (Mat Waites) (04/06/88)

Commodore doesn't supply anything to do this...

Transactor had a program to do it quite a while back
(1-1/2 to 2 yrs) called STP (source to program)

You can also do it in basic, very slowly.
Write with wery large line numbers so as not to conflict
with your program for conversion. e.g.

50000 open file holding program
50010 get a line
50020 clear screen
50030 print line to screen
50040 print "goto 50010" to screen
50050 poke some carriage returns in the keyboard input queue
50060 set the number of chars in the queue to 2
50070 end

sorry about the pseudo-type code, I'm trying to forget basic.

anyway, the computer is fooled into taking the input
from the screen and tokenizing it into basic.

mat

-- 
  W Mat Waites                     |  PHONE:  (404) 727-7197
  Emory Univ Cardiac Data Bank     |  UUCP:   ...!gatech!emcard!mat
  Atlanta, GA 30322                |

heinicke@uwovax.uwo.cdn (04/16/88)

In article <7089@drutx.ATT.COM>, csr@drutx.ATT.COM (cd) writes:
> 
>   Is there some way on a C64 to convert a text file to a loadable BASIC
> file.  Two examples of why I need to do this are:
>   - I have a "listing" on diskette, but not the executable
>   - I want one BASIC program to write another BASIC program
> I readily admit ignorance about the C64, but can't find anything in the
> documentation about how to do what i want.
> 
One way to accomplish the first objective is described on page 159-160
of the June 1982 issue of COMPUTE!. The procedure given there is for a
PET and a VIC-20, and some of the POKES may have to be changed, but 
a glance at the Programmer's Reference Manuals for (say) VIC & C-64
should reveal what changes to make.

Probably a local Commodore Users Group could help, too.