Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help converting returned values
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01097050
Message ID:
01097089
Views:
17
This message has been marked as the solution to the initial question of the thread.
John,

"Long" in VB notation is DWORD, occupies 4 consecutive bytes. Use the following procedure to convert any 4 characters from a string buffer to numeric value.
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)
In particular,
nMaxEdgeCrop = buf2dword(SUBSTR(lcDocStatus, 1, 4))
nSpecklesRemoved = buf2dword(SUBSTR(lcDocStatus, 5, 4))
nStandardCkSize = buf2dword(SUBSTR(lcDocStatus, 9, 4))
* ... and so on ...
This is your lcDocStatus
MaxEdgeCrop SpecklesRemoved StandardCkSize ...
1 2 3 4     5 6 7 8         9 a b c
[][][][]    [][][][]        [][][][]
LONG        LONG            LONG
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform