[<<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.ClipX.Net --- NG 2 HTML conversion by Dave Pearson