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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding Binary in a Text File

Status
Not open for further replies.

trawithya

Programmer
Oct 18, 2012
6
US
Is anyone aware of a way in Progress to embed Binary values into a text file? I am attempting to write PCL code for a color printer and need to imbed some values for commands as Binary values.

Any help is appreciated.

 
Use the CHR() function to build your PCL string as a char type variable, and then either use PUT CONTROL to send the PCL control string to the printer or embed the PCL control string in your printline. Consult an ASCII code table for the decimal value equivalent of your binary data.

For example, CHR(27) will give an ESCAPE character, the first character in all PCL control strings.
 
Thanks, this helps a lot. I do have another question though.

The first character I need to embed is actually NULL or CHR(00). Is there a good way to do that? When I put it in the string it drops the null value.

 
Figured it out. Used PUT CONTROL NULL.

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top