Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert hexa to decimal
Message
From
13/06/2008 03:36:10
 
 
To
13/06/2008 01:39:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01323395
Message ID:
01323715
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform