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

Re: Basic



Karl Horster (khorster@attila.stevens-tech.edu) wrote:
: 	Is there anyone to put a Applesloth file into Text for easy 
: printout?  I'm trying to print out one thorugh the standard PR#1 LIST, 
: but there must be control characters buried or something it prints over 
: lines and generally doesn't work.  I thought I remembered hearing about 
: viewers that could do that....

Okay, here are the answers...
a.  If you are on a IIgs, go into the printer port control panel and reset
the LINE LENGTH from "unlimited" to "80".  This will solve the problem with
]PRINT CHR$(4);"PR#1":LIST:PRINTCHR$(4);"PR#0"
(okay, so that's the fancy way 8-) )

b.  If you are not on a IIgs, or if you are on a IIgs and not using the
printer port, consult your printer card docs or printer docs and find the
command or DIP switch setting to force a line-turn at the nth character.

Your problem is that Applesoft does not send carriage returns at the end
of the line.  If you want to put the program into a TEXT file, try adding
the following line to the program:

0 PRINT CHR$(21):POKE 33,33:PRINT CHR$(4);"OPEN MY PROGRAM.TXT":PRINT
  CHR$(4);"WRITE MY PROGRAM.TXT":LIST 1,63999:PRINT CHR$(4);"CLOSE":TEXT:END

Of course, if you are using ProDOS, you will want to change "MY
PROGRAM.TXT" to a legal ProDOS pathname.  As an added bonus, you can then
use your favorite word processor to edit the program, then change it back
to Applesoft as follows:

]FP:REM If you are using ProDOS, you must use "NEW" instead.

]EXEC MY PROGRAM.TXT
(note...in ProDOS, use the legal ProDOS pathname.  You can use "-" instead
of EXEC, as well.)
(note also:  if you want to watch the program being reconstructed AND you
are working under DOS 3.3, you can type MON I before EXECing the file.)

This is a useful tactic, by the way, for adding libraries to an Applesoft
program.  For example, I have a nifty little routine that flashes "TOUCH
NOW" at the bottom of the screen while waiting for a keypress.  Instead of
retyping that routine for every program that uses it, I can write my
program, and when I realize I need that routine (which always lives at
line 60010), I just stick in the disk and type, "EXEC TOUCH NOW".  The
routine then becomes part of my program.  How nice!

If you just want BASIC program listings that were written the way I write
BASIC programs (i.e. come as close to 238 characters/program line as you
can) to come out looking like they were written in Pascal (i.e. each
instruction on its own line, loops called out, conditionals identified,
etc), I suggest XLISTER, a Beagle Bros utility from ...um... I think it
was on Utility City.  Just load your program then EXEC XLISTER.  Works great!

--Dave Althoff, Jr.  (with a post more like the ones I write for
rec.roller-coaster...!)
-- 
    /-\        _       _               __*** Closed for the season ***
   /XXX\      /X\     /X\_      _     /XX\_      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX