home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s3.arc / PRINTSPO.MOD < prev    next >
Text File  |  1988-01-06  |  2KB  |  51 lines

  1. (*----------------------------------------------------------------------*)
  2. (* Print_Spooled_File -- Write a character to printer from spooled file *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Print_Spooled_File;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Print_Spooled_File                                   *)
  10. (*                                                                      *)
  11. (*     Purpose:    Writes character to printer from spooled file        *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Print_Spooled_File;                                           *)
  16. (*                                                                      *)
  17. (*     Calls:                                                           *)
  18. (*                                                                      *)
  19. (*        Close                                                         *)
  20. (*        BlockRead                                                     *)
  21. (*                                                                      *)
  22. (*----------------------------------------------------------------------*)
  23.  
  24. VAR
  25.    Err : INTEGER;
  26.  
  27. BEGIN (* Print_Spooled_File *)
  28.  
  29.    IF ( Spool_Buffer_Pos > Spool_Buffer_Count ) THEN
  30.       BEGIN
  31.          BlockRead( Spool_File, Spool_Buffer^,
  32.                     Max_Spool_Buffer_Count,
  33.                     Spool_Buffer_Count );
  34.          Err              := Int24Result;
  35.          Spool_Buffer_Pos := 0;
  36.       END;
  37.  
  38.    Spool_Buffer_Pos := SUCC( Spool_Buffer_Pos );
  39.  
  40.    IF ( Spool_Buffer_Count > 0 ) THEN
  41.       Write_Prt( Spool_Buffer^[ Spool_Buffer_Pos ] )
  42.    ELSE
  43.       BEGIN
  44.          CLOSE( Spool_File );
  45.          Err            := Int24Result;
  46.          Print_Spooling := FALSE;
  47.          DISPOSE( Spool_Buffer );
  48.       END;
  49.  
  50. END   (* Print_Spooled_File *);
  51.