Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open,read,convert
Message
De
14/11/2001 02:33:42
Antonio Lopes (En ligne)
BookMARC
Coimbra, Portugal
 
 
À
13/11/2001 22:43:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00581297
Message ID:
00581339
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform