Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - getprnhandle() return the handle of the current print device http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getprnhandle()      Return the handle of the current print device
------------------------------------------------------------------------------
 Declaration
   printer.hdr

 Syntax
   func int getprnhandle extern

 Arguments
   None.

 Return
   The handle of the current print device.

 Description
   This function returns the DOS file handle which is associated with
   the current print device.

   DOS, by default, assigns handle STD_PRN (4) to the print device. New
   print devices can be opened by the set printer to command.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_getprnhandle
   ? getprnhandle()                 // prints 4
   set printer to "LPT1"            // set printer to parallel port 1
   ? getprnhandle()                 // prints 5
   set printer to "hello.txt"       // set printer to a file
   ? getprnhandle()                 // prints 5
   set printer to                   // reset printer to default device
   ? getprnhandle()                 // prints 3
   endproc

   proc main
   Test_getprnhandle()
   endproc

See Also: __prnhandle set device to set printer to

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson