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

Re: Apple BASIC question



In article <yahnke-060593172431@oleary.macc.wisc.edu> yahnke@macc.wisc.edu (Ross Yahnke) writes:
>What command can you enter in Apple Basic that will cause the basic
>program listing to be saved to disk as a text file?
>
>Thanks! - Ross

   Make this the starting line in your program (renumbering things as 
necessary):
1 D$=CHR$(4):PRINT D$"OPEN LISTING": PRINT D$"WRITE LISTING":POKE 33,33:
  LIST 2,65000: ? D$"CLOSE": TEXT: END

   This should be all one line. If you want, here's a bit of s description:
a) The variable D$ is set as a flag to the operating system that commands that
   follow it are disk commands.
b) The file LISTING is opened on disk (LISTING can be changed to any legal
   file name as long as both instances are changed), then set to be written to.
c) A poke sets Basic into a better listing mode, where really extraneous spaces
   are deleted.
d) The rest of the program (not including this line) is listed.
e) The disk file is closed.
f) TEXT puts the text screen back to normal (c set it to a different one)
g) the listing gracefully ends without running your program.

>                                     Madison Academic Computing Center
>                                               University of Wisconsin
>                                                          608.262.8626


-- 
* Nathan Mates nathan@cco.caltech.edu * MSC #850, Pasadena  CA 91126
* No fancy quote, no disclaimers for irate employers, no .sig-- oops,
* Too late for that! Several Megabyte joke collector and IIGS hacker 
* operating out of Caltech, the world's best place for an education!