Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to replace one character by another with PCL 1

Status
Not open for further replies.

martincab

Programmer
May 12, 2003
39
US
Is there any PCL command to replace one character by another?

I'm migrating tons of oracle ascii reports from esc/p to PCL. Thanks to the great stuff i found here, i didn't need to change any line of oracle code. I've done the job by changing the printer definition file.

The last remaining thing i need to do is to replace the "=" character by the "_" to improve the look of the reports.

Thanks for any idea.


Martin
 
I don't know of a PCL command to arbitrarily change one character to another, but you could put your text file through a filter to make the change before printing.

If you are on UNIX, the 'tr' command would do nicely, otherwise a 10 line C-program would do it.



Jim Asman
jlasman@telus.net
 
If the change in character refers to underlining.
For example using the equal = for double underlining and
dash - for single underlining and you want to underline
the text, using the underline character _ may not give you
the results you want. Here are a couple of suggestrions.

If using a fixed font at 10,12,16.66 cpi you should be
able to use chr$(27);"(10U" then use the line-draw characters chr$(205) and chr$(196) to replace = and - respectively.

If you want the underline on instead you will need to
use the underline on/off statement before and after the text. and eliminate the = or - characters.

Example
chr$(27);"&d0D";"This text is underlines";chr$(27);"&d@"

(use 0D for fixed underlining [leading trailing apaces underlined] or 1D for floating underline.)
 
Thanks for the useful tips.

The tr command has done the job very well and easily.


Martin Cabrera
Colombia South America.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top