wraithdu Posted October 12, 2009 Posted October 12, 2009 What kind of comparison is AutoIt doing here? Numeric or string? It seems like string to me, and that doesn't seem correct. ;broken ConsoleWrite((Ptr(5) = 5) & @CRLF) ConsoleWrite((Ptr(5) > 0) & @CRLF) ConsoleWrite((Ptr(5) < 0) & @CRLF) ; works ConsoleWrite((Number(Ptr(5)) = 5) & @CRLF) ConsoleWrite((Number(Ptr(5)) > 0) & @CRLF) ConsoleWrite((Number(Ptr(5)) < 0) & @CRLF)
Richard Robertson Posted October 12, 2009 Posted October 12, 2009 It's possible that instead of a pointer that equals 5, you got a pointer to a 5. The help file doesn't describe the result very well.
wraithdu Posted October 12, 2009 Author Posted October 12, 2009 The Ptr() function converts an expression into a pointer variant. A ConsoleWrite() of Ptr(5) outputs "0x00000005". For example, DllCall functions that can return INVALID_HANDLE_VALUE must be compared to Ptr(0xFFFFFFFF).
Richard Robertson Posted October 13, 2009 Posted October 13, 2009 I see. I don't really know what to tell you there. It doesn't make much sense to store it in a string.
Valik Posted October 13, 2009 Posted October 13, 2009 Uhh, somebody forgot to implement the logic for comparing pointers. There is literally no code there to do the comparison correctly. It will be fixed in the next beta.
Richard Robertson Posted October 13, 2009 Posted October 13, 2009 Well that explains why it doesn't work. So what kind of answer was it giving? A null?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now