Check Printer in Qbasic 
Author Message
 Check Printer in Qbasic

How do you  check that a parallel dot matrix printer is online  in
QuickBasic?
Thanks,

JB



Sat, 27 May 2000 03:00:00 GMT  
 Check Printer in Qbasic

Quote:

> How do you check that a parallel dot matrix printer is online in
> QuickBasic?

'  **************************************************
'  *                 PRNTEST.BAS                    *
'  *                                                *
'  *              Test Printer Ready                *
'  *                                                *
'  *              Judson D. McClendon               *
'  *              Sun Valley Systems                *
'  *              329 37th Court N.E.               *
'  *              Birmingham, AL 35215              *
'  *                 205-853-8440                   *
'  **************************************************
'
' $INCLUDE: 'QBX.BI'
'
' Must link with QBX.LIB: LINK PRNTEST,,,QBX;
'
DIM Regs AS RegType, Printer AS INTEGER

DO
   INPUT "Enter Printer (1,2,3):", Printer
LOOP WHILE (Printer < 1 OR Printer > 3)

Regs.ax = &H200
Regs.dx = Printer - 1
CALL Interrupt(&H17, Regs, Regs)

IF ((Regs.ax AND &H2800) OR (Regs.ax AND &H1000) = 0) THEN
   PRINT "Printer not ready"
ELSE
   PRINT "Printer ready"
END IF
END
--
Judson McClendon          This is a faithful saying and worthy of all
Sun Valley Systems        acceptance, that Christ Jesus came into the

(please remove zzz from email id to respond)



Mon, 29 May 2000 03:00:00 GMT  
 Check Printer in Qbasic

Quote:

>How do you  check that a parallel dot matrix printer is online  in
>QuickBasic?
>Thanks,
>JB$LIB ALL OFF

 DECLARE FUNCTION PrinterReady% ()

'Demo code -----------------------------------------------------------

 PRINT "LPT1 is ";
 IF PrinterReady% THEN
   PRINT "ready."
 ELSE
   PRINT "NOT ready."
 END IF
'---------------------------------------------------------------------

'=======================
 FUNCTION PrinterReady% ()
'=======================  

  DIM RetVal AS LOCAL INTEGER

ASM  Mov RetVal, 0         ; assume not ready
ASM  Mov AH, 2             ; set up the call
ASM  Int &H17              ; returns printer status in AH
ASM  And AH, &H80          ; isolate the high bit
ASM  Or  AH, AH            ; not set means not ready
ASM  Jz  NotReady
ASM  Mov RetVal, &HFFFF    ; flag printer ready (-1)

NotReady:

  PrinterReady% = RetVal

END FUNCTION



Mon, 29 May 2000 03:00:00 GMT  
 Check Printer in Qbasic


|>
|> >How do you  check that a parallel dot matrix printer is online  in
|> >QuickBasic?
|>
|> '=======================
|>  FUNCTION PrinterReady% ()
|> '=======================  
|>
|>   DIM RetVal AS LOCAL INTEGER
|>
|> ASM  Mov RetVal, 0         ; assume not ready
|> ASM  Mov AH, 2             ; set up the call
|> ASM  Int &H17              ; returns printer status in AH
|> ASM  And AH, &H80          ; isolate the high bit
|> ASM  Or  AH, AH            ; not set means not ready
|> ASM  Jz  NotReady
|> ASM  Mov RetVal, &HFFFF    ; flag printer ready (-1)
|>
|> NotReady:
|>
|>   PrinterReady% = RetVal
|>
|> END FUNCTION

This function won't work, as written, in QuickBASIC. It is
designed for powerbasic 3.x, and uses the inline assembler
feature of that compiler.

I should know. I wrote this code. (It is good to see it has
a life of its own, now.)

--
Brian McLaughlin, Technical Writer  |"Thanks to the Internet, misinformation
Integrated Measurement Systems, Inc.| now travels faster than ever before!"
Beaverton, OR, USA                  | ---- Standard disclaimer applies ----



Tue, 30 May 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Sending Printer Commands to Printer using QBASIC

2. simple question about to check existing directories in qbasic

3. Checking Keyboard Buffer in Visual Basic for DOS or QBasic

4. Checking for characters in QBASIC

5. Check out : A melody using QBASIC

6. Directory Syntax Checking in QBasic

7. Checking Keyboard Buffer in Visual Basic for DOS or QBasic

8. printer output difficulty with Qbasic

9. Qbasic and printer problem

10. DEF SEG and Lprinting multible printers QBASIC.

11. QBasic Printer Woes

12. Printer help - Qbasic

 

 
Powered by phpBB® Forum Software