Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to print Applesoft BASIC code to ImageWriter II?

804 views
Skip to first unread message

Matthew Power

unread,
Dec 27, 2016, 10:04:32 PM12/27/16
to
I'm having fun learning the machine via coding! I currently use Alan Bird's Program Writer and it's great. But I can't get it to print the code on my ImageWriter II via super serial card in slot 1.

Does anyone know how to print Applesoft BASIC code on an ImageWriter II?

Matthew Power

unread,
Dec 27, 2016, 10:06:01 PM12/27/16
to
Oh, forgot. I'm using a IIe.

Don Bruder

unread,
Dec 27, 2016, 11:06:42 PM12/27/16
to
In article <bac98bb3-ec42-4245...@googlegroups.com>,
Since you say your card is in slot 1 -

PR#1 -- send output to card in slot 1
LIST -- or a subrange of lines
<Ctrl-Reset> is the quickest way I recall to turn off the printer after
the listing is done. PR#3 if you want to be in 80 columns. Odd as it may
sound, I preferred to do my BASIC coding in 40-columns back in the day,
and found that just hitting reset after printing a listing would dump me
back to "normal" quicker and more reliably than actually typing "PR#0".
(or worse, and more likely, "typoing" it into something that gets a
SYNTAX ERROR printed at the end of the listing)

--
Brought to you by the letter K and the number .357
Security provided by Horace S. & Dan W.

gid...@sasktel.net

unread,
Dec 27, 2016, 11:41:04 PM12/27/16
to
On Tuesday, December 27, 2016 at 10:06:42 PM UTC-6, Don Bruder wrote:
> In article <bac98bb3-ec42-4245...@googlegroups.com>,
That's the easy way for Dos 3.3, but Prodos has a command that returns to the prompt after the listing is printed. I believe it is called "DUMP" and installs between Basic.system and its buffers. So, printing is as simple as typing the word "DUMP" at the applesoft prompt.

If pushed, I could probably try and locate it for you on the net, but it would probably be easier to send a disk image from my archives.

Matthew Power

unread,
Dec 31, 2016, 8:46:59 PM12/31/16
to
> Since you say your card is in slot 1 -
>
> PR#1 -- send output to card in slot 1
> LIST -- or a subrange of lines

Thank you, that was so simple! I feel silly. But it does give me ideas about writing BASIC programs that could use this..

Thanks!

Matt

Don Bruder

unread,
Dec 31, 2016, 8:56:35 PM12/31/16
to
In article <e8318c59-8dd1-469e...@googlegroups.com>,
Just remember that if you put it in a program, it's not a "BASIC"
command - it's a DOS command - Put it in as a "plain" PR#1, and you'll
"lose" DOS. Make sure you do it as PRINT CHR$(4);"PR#1" (or equivalent)
like you would for any other DOS command like BSAVE or BLOAD. (The LIST,
on the other hand, will work fine without the ctrl-D)

Matthew Power

unread,
Dec 31, 2016, 9:01:28 PM12/31/16
to

> Just remember that if you put it in a program, it's not a "BASIC"
> command - it's a DOS command - Put it in as a "plain" PR#1, and you'll
> "lose" DOS. Make sure you do it as PRINT CHR$(4);"PR#1" (or equivalent)
> like you would for any other DOS command like BSAVE or BLOAD. (The LIST,
> on the other hand, will work fine without the ctrl-D)

Thanks again! I was just trying to figure that out!!!

KP

unread,
Jan 1, 2017, 2:25:22 PM1/1/17
to
Another trick that can save you 4 characters in typing in BASIC code is the following:

Rather than typing this:

10 PRINT CHR$(4);"PR#1"

Instead, type 10 PRINT "

Then, after typing the quotation marks, physically type CONTROL-D on your keyboard. Applesoft will record the keypress as a CONTROL-D, even though no confirmatory character will appear on the screen.

Then, having typed a CONTROL-D, type PR#1"

I discovered that little maneuver years and years ago while reading someone else's source code listing and wondering why none of the beep commands were prefaced by CHR$(7); (the equivalent of CONTROL-G), and then realizing that the beep noise was audible every time it occurred in a LIST of the code, and that must mean that the CONTROL-G had been typed into the quotation text. Sample principle applies to CONTROL-D (or any other CONTROL character).

Another old, but far more well-known, trick, is to type PRINT commands as a question mark (?). AppleSoft will automatically convert the question mark into a PRINT command and display it as such when you LIST the code. I believe the PRINT/? equivalency is universal across all 1970s/1980s-era BASIC dialects.

Don Bruder

unread,
Jan 1, 2017, 4:13:22 PM1/1/17
to
In article <dbb7e0c4-4742-4323...@googlegroups.com>,
Functional? Yes. No argument. Good practice? No. Unless you're dealing
with a project so large (or artificially constrained, like the old
Beagle-brothers "two-liners") that saving every possible byte is
mandatory, all that method does is make things more difficult than it
needs to be (notice I don't say, or even intend to imply, "impossible")
for anyone who comes along behind you to understand or make use of the
code.

Obfuscating code is *ALWAYS* a less-than-good idea, and often leads to
more problems than it solves.

Michael J. Mahon

unread,
Jan 1, 2017, 5:11:04 PM1/1/17
to
KP <kjp...@gmail.com> wrote:
> Another trick that can save you 4 characters in typing in BASIC code is the following:
>
> Rather than typing this:
>
> 10 PRINT CHR$(4);"PR#1"
>
> Instead, type 10 PRINT "
>
> Then, after typing the quotation marks, physically type CONTROL-D on your
> keyboard. Applesoft will record the keypress as a CONTROL-D, even though
> no confirmatory character will appear on the screen.
>
> Then, having typed a CONTROL-D, type PR#1"
>
> I discovered that little maneuver years and years ago while reading
> someone else's source code listing and wondering why none of the beep
> commands were prefaced by CHR$(7); (the equivalent of CONTROL-G), and
> then realizing that the beep noise was audible every time it occurred in
> a LIST of the code, and that must mean that the CONTROL-G had been typed
> into the quotation text. Sample principle applies to CONTROL-D (or any
> other CONTROL character).

But, as you noticed, typing control characters into source code damages
readability significantly.

If there is enough memory to allow even one REMark in a program, then all
control characters should be made visible by using CHR$.

The number of keystrokes is never a good measure of program quality. ;-)
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

Steve Nickolas

unread,
Jan 1, 2017, 9:36:18 PM1/1/17
to
On Sun, 1 Jan 2017, KP wrote:

> Another old, but far more well-known, trick, is to type PRINT commands
> as a question mark (?). AppleSoft will automatically convert the
> question mark into a PRINT command and display it as such when you LIST
> the code. I believe the PRINT/? equivalency is universal across all
> 1970s/1980s-era BASIC dialects.

Not quite universal (Integer Basic and BBC Basic don't support it), but
all Microsoft dialects support it and Atari Basic supports it as well.

-uso.
0 new messages