.BIN Routine for Releasing Network Print Spooler

ID: Q98687


The information in this article applies to:


SUMMARY

To release the network print spooler after sending information to the printer, you can write a .BIN routine using the MS-DOS Debug program, as explained below.


MORE INFORMATION

To create the .BIN routine, use the code below. Do not type the semicolons or explanations following the semicolons.


   C:\>debug             ; At the MS-DOS prompt, type DEBUG.
   -nSP_OUT.BIN          ; Provide a filename with a .BIN extension.
   -a 100                ; Assemble at address 100.
                         ;
                         ; The address segment after the colon is
                         ; significant--the first 4 numbers may differ.
   2883:0100 MOV AX,5F04 ; Load the printer output control code
                         ; (for 3Com, LANtastic, or LAN Manager,
                         ; change 5F04 to 5D09;
                         ; 5F04 cancels network redirection of device).
   2883:0103 INT 21      ; Call the MS-DOS interrupt routine.
   2883:0105 RETF        ; FoxPro-called routines need far return.
   2883:0106             ; Press ENTER at the blank line.
                         ;
   -rbx                  ; Access the base register.
   bx 0000               ; This should be 0000; if so, press ENTER. If
   :                     ; it is anything else, type 0 and press ENTER.
   -rcx                  ; Access the count register.
   cx 0000               ; Disregard whatever is here; it will be
   :6                    ; changed to 6 bytes.
   -w                    ; Write the program to disk.
   Writing 0006 bytes    ; Message confirms write.
   -q                    ; Quit to MS-DOS. 
To use SP_OUT.BIN, load it early in the program, and then call it at the points where output to the printer is completed. For example:

   LOAD sp_out             && Loads SP_OUT.BIN.
   SET PRINTER TO LPT2:
   SET DEVICE TO PRINT
   @ .... SAY .......      && Printer output goes here.
   @ .... SAY .......
   CALL sp_out             && Begin printing (call not needed
                           && with LANtastic).
   SET DEVICE TO SCREEN
   RELEASE MODULE sp_out   && Release SP_OUT.BIN when finished. 
This callable .BIN routine closes an open LAN spool file on some networks without you having to issue a SET PRINTER TO \\SERVER\PRINTER command. This routine should be useful in multiuser FoxBASE+ environments because the SET PRINTER TO command that can be used in FoxPro does not close the spool file in FoxBASE+, making it necessary for the user to press CTRL+ALT+PRINT SCREEN or use the .BIN routine.

Additional query words: FoxDos print network bin spool


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: August 12, 1999