You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
LOCAL iret AS LONG or DWORD
iRet = WaitForSingleObject (hObj, TimeOutVal)
SELECT CASE [b]AS LONG[/b] iret
CASE %WAIT_OBJECT_0
CASE %WAIT_TIMEOUT
CASE %WAIT_FAILED
SELECT CASE AS LONG does 32-bit comparisons; SELECT CASE does signed comparisons (PB/WIn 7+ only. Prior versions always did 32-bit compares).
FWIW, "SELECT CASE AS LONG" also executes more quickly than "SELECT CASE", not that it would be terribly significant in this case.
"AS LONG" is the ONLY way to go in message-processing loops; this becomes really significant when working with any of the Microsoft Common Controls (listview, treeview, header, etc), as almost all the 'notification codes' passed in the NMHDR.code value in lparam of the WM_NOTIFY message are "negative" when viewed as signed.
I see that in PB/Win 9x there is also now a function to deal with signed comparisons: the BITSE function.
No Pb/Win 9x or CC/5x?
Code:
MACRO eq32 (a, b) = BITS???(a) = BITS???(b)
...
IF eq32 (X, Y) THEN ...
(Macro courtesy Tom Hanlin, a long time ago, right here).
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment