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 - __cvtprncwi printer character conversion function pointer http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 __cvtprncwi         Printer character conversion function pointer
------------------------------------------------------------------------------
 Declaration
   printer.hdr

 Syntax
   ptr(_PCVT) __cvtprncwi

 Default
   0 (no function installed)

 Description
   The __cvtprncwi system variable contains a pointer to a user-definable
   function which is called back by the Force runtime system while printing.
   The callback function receives the character being printed and has the
   opportunity to return after changing it. The facility can be used for
   printer character set conversions.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   func byte PrnConvert
   param value byte bChar
   if bChar == "@"         // convert printed '@' characters to 'X'
      bChar := "X"
   endif
   return( bChar )
   endfunc
   
   proc PrintTest static
   @ 1, 0 say "These are @@@ characters"
   ? "@"
   ?
   endproc
   
   proc Test_cvtprncwi
   set margin to 3
   set printer to "test.txt"
   set device to print
   set print on
   PrintTest()
   __cvtprncwi := &PrnConvert      // set converter routine
   PrintTest()
   __cvtprncwi := 0L               // clear conversion
   PrintTest()
   endproc

   proc main
   Test_cvtprncwi()
   endproc

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