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

Re: Apple IIe printing



Miroslav Ostric wrote:
> 
> I tried in AppleSoft to print text via pr#6, but it prints also the

Slot 6? That's a strange location to print from. Usually, slot 6
contains a disk drive. But don't let that stop you...

> linenumber of the BASIC-program which actually runs. For example:
> 10 ?#6:?"hello"
> On the screen and on paper it prints: [10] hello

If you run under a disk operating system such as DOS 3.3 or ProDOS, you
should use the command PRINT CHR$(4)"PR#6" rather than just PR#6, since
PR#6 all by itself disconnects Basic from the OS (until the next time
the computer asks for input).
In ProDOS, this will result in the output of the line number, since
ProDOS leaves the TRACE routine running invisibly to interface with your
program. So if you disconnect ProDOS, The TRACE output will become
visible.

Therefore, the solution is to change your program to

 10  PRINT  CHR$(4)"PR#6": PRINT "hello"

and it will work as you intend.
In this example, I am assuming that the output of your program is #10
hello rather than the [10] hello you mention. If I am incorrect, you may
have other problems!

> Can I avoid this effect? Must I adress the printerport directly with a POKE,
> and when yes, what is the adress?

No, you can't access the printer port directly, at least not in the way
you imagine. The way to do that differs from card to card. The method
used above is the preferred way from within AppleSoft.

Pim Blokland