Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convertion
Message
 
À
11/01/2001 11:13:58
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00462269
Message ID:
00462515
Vues:
10
>I need to convert an hexadecimal(16) number in decimal(10). How ?
First of all, i think you mean hex(10) = dec(16)
what you can do is something like this

(VFP code, but it is for the idea)
decimal = 0
for i = 1 to len(hexstring)
   lchexnumber = substr(hexstring,i,1)
   lnhexnumber = at(lcHexNumber,'0123456789ABCDEF') - 1 && or another variant of this
   decimal = decimal * 16 + lnhexnumber
endfor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform