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

Hex Code

Status
Not open for further replies.

RTorrance

Programmer
Apr 12, 2002
64
CA
Hello,
I am trying to send some hex code to a com printer port.
This is the code:

set printer to name \\computername\printername
??? '<STX>1 0<ETX>'
set printer to

The second line needs to be in hex and I can't figure out how. I have tried:
??? '0x020x310x300x03'
??? '\x02\x31\x30\x03'

If anyone can help it would be greatly appreciated.
 
Try:
Code:
chr(2)+chr(31)+chr(30)+chr(3)

Mike Krausnick
Dublin, California
 
Correction, convert those values to decimal:
Code:
chr(2)+chr(49)+chr(48)+chr(3)

Mike Krausnick
Dublin, California
 
Thank You very much for your reply. The chr(0x20)...worked!!!
Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top