In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
Home page Home page Home page Home page
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel

Reader's Clinic - Changing from LPT1 to LPT2 in RBASIC

Both Patrick Collins of Softsolve Computer Systems and Jonathan Bird of Argyle Fabrics asked the same question recently - "How can one change from LPT1 to LPT2 from within RBASIC?".

The solution to this is straightforward, and covered already (albeit indirectly) in REVMEDIA 6:4. RevTech also referred me back to SETPTR.

As previously documented, the SETPTR routine redirects printer i/o to a nominated file. To DOS, LPT1 and LPT2 are reserved filenames and to all intents and purposes can be treated as files. Thus to change to LPT2 simply

0001     CALL SETPTR("LPT2" : CHAR(0),1)

and to change back to LPT1,

0001     CALL SETPTR("LPT1" : CHAR(0),1)

(Volume 2, Issue 3, Page 3)
Pixel Footer R1 C1 Pixel