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

 Syntax
   func byte _PCVT ptr
   param value byte bChar

 Arguments
   bChar is the character being printed.

 Return
   The character to print.

 Description
   The _PCVT function type is used to declare a pointer to a function
   that converts characters during printing. The function type is used to
   install a print converter function by setting the value of the
   __cvtprncwi system variable to the address of the respective function.

 Example
   #define EXAMPLE_TYPE
   #include example.hdr

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

   proc main
   Test_PCVT()
   endproc

See Also: __cvtprncwi

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