Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hex Vexation
Message
De
03/05/1998 10:41:35
 
 
À
03/05/1998 09:02:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00096588
Message ID:
00096591
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform