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'
'
'
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
ELSE
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

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

PRINT "LPT1 is ";
ELSE
END IF
'---------------------------------------------------------------------

'=======================
'=======================

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  Mov RetVal, &HFFFF    ; flag printer ready (-1)

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?
|>
|> '=======================
|> '=======================
|>
|>   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  Mov RetVal, &HFFFF    ; flag printer ready (-1)
|>
|>
|>
|> 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

 Page 1 of 1 [ 4 post ]

Relevant Pages