Category : BASIC Source Code
Archive   : BAS_INT1.ZIP
Filename : PRINTER.BAS

 
Output of file : PRINTER.BAS contained in archive : BAS_INT1.ZIP
'===================================================================
' Quick Basic Forum
' Date : 13-May-91
' From : David Rice
'Subject : printer status; error messages
'=================================================================
err.code% = 1
call printer.check(err.code%)
'
' Snibbit by Robert Campbell.
' sub-program : printer.check(err.code%)
' purpose : check the status of the printer and return any errors
' inputerr.code% : the line printer port to be tested (lpt1 = 1)
' output err.code% : returns 0 if printer is ready
' err.code% = 8 Printer I/O Error
' err.code% = 32 The Printer is Out Of Paper
' err.code% = 16 The Printer is Off Line
'
sub printer.check(err.code%) static
defint a-z
if err.code% = 0 then err.code% = 1

dim inary%(7),outary%(7)

inary%(0) = &h0200
inary%(3) = err.code% - 1
err.code% = 0

call int86(23,varptr(inary%(0)),varptr(outary%(0)))

err.code% = 1
a = outary%(0)
a = (a / 256) and 255
if a = &h90 then err.code% = 0
if (a and &h8) = 8 then err.code% = 8 'Printer I/O Error
if (a and &h20) = 32 then err.code% = 32 'The Printer is Out Of Paper
if (a and &h10) = 0 then err.code% = 16 'The Printer is Off Line
end sub



  3 Responses to “Category : BASIC Source Code
Archive   : BAS_INT1.ZIP
Filename : PRINTER.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/