BBS: Inland Empire Archive Date: 07-03-92 (22:06) Number: 2172 From: STEVE HALKO Refer#: NONE To: JIM TANNER Recvd: NO Subj: Lprint and printers Conf: (2) Quik_Bas
JT> I worked your routine into a Function as shown below. I use a true JT>blue Epson printer. I can't get this to return TRUE when the JT>Printer is online and ready. I use LPT1 as my port. Can you JT>tell me what I've done wrong.? JT>'================================= JT>FUNCTION CheckPrn% (Port) JT>DIM Regs as RegType JT>Regs.ax = &H200 JT>Regs.dx = Port JT>CALL INTERRUPT(&H17, Regs, Regs) JT>Status% = Regs.ax \ 256 JT>IF Status% = 144 THEN JT> CheckPrn% = TRUE JT>ELSE JT> CheckPrn% = FALSE JT>END IF JT>END FUNCTION Could be one of two things Jim: 1. I didn't see any definitions for TRUE or FALSE in your code. 2. On some printers, you need to ignore the NOT BUSY flag and the ACK flag. So before you test Status%, you need to turn bit 7 on, and turn bit 6 off: Status% = (Regs.ax \ 256) OR 128 'Turn bit 7 on Status% = Status% AND 191 'Turn bit 6 off IF Status% = 144 THEN etc. * SLMR 2.1a * If yogurt goes bad, how can you tell? --- DB B1073/002487 * Origin: Gulf Coast BBS -QuickSHARE #2- (904)563-2547 HST/V.32bis (1:365/12)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET