home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / apple2 / 23817 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  2.7 KB

  1. Path: sparky!uunet!ornl!utkcs2!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!PHYSICS.WM.EDU!wrh
  2. From: wrh@PHYSICS.WM.EDU (William Hall)
  3. Newsgroups: comp.sys.apple2
  4. Subject: Re: AppleSoft Basic Question
  5. Message-ID: <9211122123.AA16159@physics.wm.edu>
  6. Date: 12 Nov 92 21:23:21 GMT
  7. References: <9211120306.AA12528@physics.wm.edu>
  8. Sender: daemon@ucbvax.BERKELEY.EDU
  9. Distribution: world
  10. Organization: The Internet
  11. Lines: 46
  12.  
  13. As typed by Eric D. Shepherd ...
  14. > Okay... to place the Applesoft source into a text file, add this line to
  15. > the beginning of the program, then run it:
  16. > 1 PRINT CHR$(4)"OPEN FILENAME":PRINT CHR$(4)"WRITE FILENAME":LIST 2-:PRINT
  17. > CHR$(4)"CLOSE":END
  18. > Don't forget to delete line 1 after you've done this!
  19. > To convert the text file back to an Applesoft program, just type:
  20. > EXEC FILENAME
  21. > That's it!
  22. > - Eric S.
  23. > --
  24. > Eric D. Shepherd                   | Apple II Alliance Charter Member
  25. > InterNet: uerics@mcl.mcl.ucsb.edu  |           ACM Member
  26. > FidoNet:  1:206/2713 Eric Shepherd | Programming Law #1: "When in
  27. > AOL:      Sheppy                   | doubt, rewrite from scratch."
  28.   That's almost it.  Before running line 1, either type
  29. POKE 33,33
  30.   or add this POKE to the beginning of line 1.  Someone had this in an earlier
  31. message, and I remember someone else asking why.  Here's why:  Without this
  32. POKE, Applesoft nicely word-wraps lines by inserting carriage returns at about
  33. the 34th column of the screen (40-column mode).  Which means that your text
  34. file will look exactly like the listing, BUT, if you EXEC this text file, you
  35. will not get the entire program as it appeared originally unless you had really
  36. short lines.  The problem is, once Applesoft sees that carriage return, it
  37. accepts the line as is, and awaits another command.  The next line it receives
  38. is the continuation of the previous line, which does not have a line number, so
  39. Applesoft assumes it is a command.  Therefore, it does NOT get entered as part
  40. of your program, and might give you a syntax error.
  41.   The POKE 33,33 sets the width of the screen to 33 columns, so Applesoft does
  42. not get a chance to insert the word-wrapping carriage returns, and the only
  43. carriage returns that show up are at the end of each line, which is exactly
  44. where we want them.
  45.  
  46.   Whew!  I guess that was a bit long-winded, but here's the quick summary:
  47.  
  48. * If you want to make a text file of an Applesoft program, AND you want to be
  49. able to turn it back into an Applesoft program, type POKE 33,33 before you run
  50. line 1 given above.
  51. -- 
  52. William R. Hall  |  wrh@physics.physics.wm.edu |  College of William and Mary
  53.                  |  hall@wmheg.physics.wm.edu  |  Department of Physics
  54.                                                |  Williamsburg, VA  23187-8795
  55.