Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I read a hex value from an ascii file
Message
De
29/11/1996 23:33:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00013211
Message ID:
00013856
Vues:
35
>>Position 1 will either be a 4 or a c. 4 indicates a positive number and c indicates a negative.
>>
>>Position 2 gives the number of decimal points.
>>
>>The following the following five positions are the actual number.
>
>Given those 7 Ascii characters in cMyStr:
>cSign=Upper(Left(cMyStr,1))
>nDecimals=Val(Substr(cMyStr,2,1))
>cDigits=SubStr(cMyStr,3)
>nValue=HexToNumeric(cDigits) / (10 ** nDecimals) * iff(cSign="4",1,-1)
>
>you didnt't say if decimal points is given in hex or not but unless the number has more than 9 decimal places it won't matter. Test:
>c200431 would be -10.73

Mark:

Thanks for your help. I will give this a shot. It is beginning to make a bit of sense.

Thanks again...
jd
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform