[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Applesoft code, how to print?
David Sebastio (sebastio@joynet.it) wrote:
: Hi everybody,
: I have a game, written in Applesoft Basic. Now, I can see the code on my
: screen using Catalog, but now I want to print it. I know that there is a
: command that force the output to the printer (slot 1, Imagewriter) but I
: don't remember it. Can you help me?
PR#n where n is the slot number of your printer card.
To shut off the printer, use PR#0
CAUTION! If you have an unenhanced ][e (displays "Apple ][" on the
power-up splash sreen instead of "Apple //e") AND you have the 80-column
card active when you issue the PR#1, then do not stop the printer with
PR#0. While this will work, it will do strange things to your screen.
Use PR#3 instead, then use Esc-^Q to shut off the 80-column card as usual.
: Another thing, how can I save this code in ASCII format, or how can I
: see the code opening it in a text editor?
If you figure out how to get a text editor to ignore the filetype and open
the file anyway, what you will see is the tokenized BASIC program, which
is fairly useless to you. You want to save the file as ASCII. Add the
following line to the beginning of the program...
0 TEXT:PRINT CHR$(21):HOME:PRINT CHR$(4):"OPEN PROGRAM.TXT":PRINT
CHR$(4);"WRITE PROGRAM.TXT":POKE 33,33:LIST 1,63999:PRINT
CHR$(4);"CLOSE":END
Then RUN the program. To retranslate the program back into Applesoft...
]NEW
]EXEC PROGRAM.TXT
You should see a long line of ] prompts, and when the file finishes
EXECing, your program should be intact.
Cautions when editing the program with a text editor--
1. Do not break program lines. The only carriage-returns in the file
should be the ones at the ends of the program lines. If you were to
copy the 'line 0' routine above and EXEC it onto your program, you would
have to take out the line breaks first.
2. Do not allow lines to exceed 238 characters.
If you hear beeping, but do not see error messages while you EXEC the
text file, your program has a too-long line in it.
Suggestion--If you really want to program with a text editor, you can insert
comments into your source code without the usual memory penalty! Just add
the comment with a REM statement but no line number. For example...
10 PRINT CHR$(21):TEXT:HOME
REM Insures that the 80-column card is off and the window is full size, and
REM then clears the screen.
20 PRINT "This is where the fun starts!"
When you EXEC this little program into memory, the comments will be
automagically stripped. See?--
]EXEC PROGRAM.TXT
]
]
]
]
]LIST
10 PRINT CHR$( 21) : TEXT : HOME
20 PRINT "This is where the fun starts!"
]
See? 8-)
--Dave Althoff, Jr.
--
\ _ _ *** Closed for the season ***
XXX\ /X\ /X\_ _ /X\__ _ _____
XXXXX\ /XXX\ _/XXXX\_ /X\ /XXXXX\ /X\ X\ /XXXXX
_ XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX