Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hexagesimal
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01017471
Message ID:
01018344
Views:
9
I have used this function to convert a number to hexedecimal. I hope it proves useful to you.

notitia abunde dominatus (knowledge is power)
Jeff
FUNCTION f_CreateHex
	LPARAMETERS nCharactureToConvert

	cRight = "0"
	nRight = 0

	cLeft = "0"
	nLeft = 0

	* Set positioning refrences
	lFirstRun = .T.

	* Loop to count up to the value needed
	FOR nTempCounter2 = 0 TO nCharactureToConvert

		IF ! lFirstRun
			IF nRight < 15
				nRight = nRight + 1
			ELSE
				nLeft = nLeft + 1
				nRight = 0
			ENDIF
		ELSE
			lFirstRun = .F.
		ENDIF

	NEXT nTempCounter2

	cTempString = "0123456789ABCDEF"
	cResults =  SUBSTR(cTempString, nLeft + 1,1) + SUBSTR(cTempString, nRight + 1,1)

	RETURN cResults
>Hi! from santo domingo.
>
>I need to know how to convert a number to hexagesimal.
>
>please some example would be welcoming!
>
>Thx.
Jeff Pearce
Previous
Reply
Map
View

Click here to load this message in the networking platform