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

convert hex data 1

Status
Not open for further replies.

mallee

Programmer
Nov 7, 2000
116
Does anyone know how I can convert a hex charater to ascii ?

I have a text input file with hex dates like 19 80 01 15
If I try asc, it returns the value of 25 for the symbol representing 19 and 128 for the one representing 80.

thank you for any suggestions.

Oh I am using fpw 2.6a
 
In fact, ASCII character is one byte (0..255) in hex,
no conversion need.
 
If you want "split" one hex byte to two characters,
try something like
hex = asc(hex)
first = floor(hex/16)
last = mod(hex,16)
twobytes = iif(first<10,chr(48+first),chr(55+first));
+ iif( last<10,chr(48+last), chr(55+last))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top