Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert hexa to decimal
Message
De
13/06/2008 03:36:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01323395
Message ID:
01323715
Vues:
20
>Thank you Gregory,
>but it's in vfp6, so I can't use strconv() function.


Here are the vfp6 counterparts then
*-------------------------------------------------------------------------
function	ath(x)
	local out, i
	out = ''
	for i = 1 to len(m.x)
		out = m.out + right(transform(asc(substr(m.x,m.i,1)),'@0'),2)
	endfor
	return	out
endfunc
*---------------------------------------------------------------------
function hta(s)

	local i, out
	store '' to out
	
	for i = 1 to len(m.s)-5 step 6
		
		store m.out + right(bintoc(val('0x' + substr(m.s, m.i, 6))),3) to out
		
	endfor
	
	if( !empty(mod(len(m.s), 6)) )
		store m.out + right(bintoc(val('0x' + right(m.s, mod(len(m.s), 6)))),mod(len(m.s), 6)/2) to out
	endif
	
	return m.out
endfunc
*---------------------------------------------------------------------------
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform