Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert a Binary Character to Integer
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00818393
Message ID:
00818525
Views:
22
Hi Roberto,

If a source value is a string of 4 chars then try to pass it to the following function:
FUNCTION buf2dword(cBuffer)
RETURN Asc(SUBSTR(cBuffer, 1,1)) + ;
	BitLShift(Asc(SUBSTR(cBuffer, 2,1)),  8) +;
	BitLShift(Asc(SUBSTR(cBuffer, 3,1)), 16) +;
	BitLShift(Asc(SUBSTR(cBuffer, 4,1)), 24)
For DWORDs or LONGs the less significant byte is on the left.
Previous
Reply
Map
View

Click here to load this message in the networking platform