Printchk.c
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 1k
Development Platform:

C++ Builder

  1. #include <bios.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. void main(void)
  5.   {
  6.     int status = 0;
  7.     int old_status = 0;
  8.     do
  9.      {
  10.        status = biosprint(2, 0, 0);  // Read LPT1       
  11.    
  12.        if (status != old_status)
  13.  {
  14.    if (status & 1)
  15.      printf ("Time-outt");
  16.    if (status & 8)
  17.      printf ("Output Errort");
  18.  
  19.    if (status & 16)
  20.      printf ("Printer Selectedt");
  21.        
  22.    if (status & 32)
  23.      printf ("Out of Papert");
  24.    if (status & 64)
  25.      printf ("Acknowledget");
  26.    if (status & 128)
  27.      printf ("Printer Not Busy");
  28.   
  29.    printf ("n");
  30.  
  31.    old_status = status;
  32. }
  33.       }
  34.     while (! kbhit());       
  35.   }