Here's the function you need:
lparameters tcString
local lnNumber, lcChar, lnI
lnNumber = 0
for lnI = 1 to len(tcString)
lcChar = substr(tcString, lnI, 1)
lnNumber = lnNumber * 100 + ;
int(asc(lcChar) / 16) * 10 + ;
asc(lcChar) % 16
endfor
return lnNumber
Vlad
>I need some help with the data conversion aspect of a project I'm working on--specifically translating some packed numeric fields into their decimal equivalents. The data is in hex, so that for example, the number 4534 would be stored in the ASCII equivalent of two bytes, '45' and '34' (which shows up in the file as "E4"). I can use the Hexedit tool that comes with VFP to look at the data, but it's a compiled app and I need the algorithm it uses so that I can do mass conversions (we're talking thousands of records). I've looked in various online utility libs and found plenty of routines that do hex conversions, but they all deal with translating numbers back and forth, not characters. Help!
>
>TIA,
>Dale Leopold - MCSD
>ElseWare