Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open,read,convert
Message
From
14/11/2001 02:33:42
 
 
To
13/11/2001 22:43:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00581297
Message ID:
00581339
Views:
17
>Can anybody explain step by step how to open,read,convert a file (hex format) into readable format (ascii), or may be give some concept how to do it.

Hi, Andreas

Does your hex file come in a normalized known format or is it just a series of hex codes (such as 32303031313131340D0A?)

If it is just a series of hex codes, you could do something of the kind
<NotRobust>
lnIn = fopen(lcHexFile)
lnOut = fcreate(lcAsciiFile)
do while !feof(lnIn)
  lcHex = fread(lnIn,2)
  lcAscii = chr(val("0x"+lcHex))
  fwrite(lnOut,lcAscii)
enddo
fclose(lnIn)
fclose(lnOut)
</NotRobust>

bye
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform