OPEN #, “p”

Author(s): Dick Wagner
Publication: The Plotter
Pub Details: The Plotter v12 n11 (Volume 12, Issue 11)
Date: November 1994
Pages: 4

I recently had occasion to make a printer copy of the text of a program that was the result of PRINTs and RUN. Not wishing to change all of the PRINTs to LPRINTs, I found that entering OPEN #2,”p” before pressing RUN, the printer printed out the text as it had appeared on the screen. OPEN #2,”p” is a Sinclair BASIC command.

Using OLIGER SAFE disk drive and printer interface, it is necessary to use LET / P=0, POKE 23324,10 (if line feed is required), POKE 23323,32 to override the 255 line length Oliger uses for default, thus printing 32 character lines. If a left margin is required, say of 15 characters, use OUT 127,27: OUT 127,108: OUT 127,15. This is the code for ESC l 15.

A simple test program in Oliger format to show the action could be like this:

10 LET /P=0
20 POKE 23324,10: POKE 23323,32
30 OUT 127,27: OUT 127, 108: OUT 127,15
40 OPEN #2,""p"""
50 PRINT "This is a test of OPEN #2, "p"."
60 CLOSE #2

The LARKEN is equally as simple

10 RANDOMIZE USR 100: OPEN #2,""LP"""
20 RANDOMIZE USR 100: POKE 16090, 32
30 REM 32 for line length
40 RANDOMIZE USR 100: POKE 16092, 10
50 REM for line feed
60 RANDOMIZE USR 100: POKE 16094, 15
70 REM left margin
80 PRINT "This is a test of OPEN #2, "LP""
90 RANDOMIZE USR 100: CLOSE #2

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.