andynewbie Posted January 19, 2007 Share Posted January 19, 2007 This code looks for a popup window that may or may not display, for valid reasons. It clicks thru the window if it does come up, or keeps going down the code, if it does not display. How can I trap for an unexpected error as well as the value returned by the function ? The "signonwrong" is a test because if the window displays, it should NOT find the "SignOn" button that is in fact there, and should NOT send an ENTER. $error = WinwaitActive("Display Form","SignOnwrong",5) If $error = 0 Then Send("{ENTER}") Else ContinueCase EndIf Link to comment Share on other sites More sharing options...
Zedna Posted January 19, 2007 Share Posted January 19, 2007 Look at AdlibEnable() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
andynewbie Posted January 22, 2007 Author Share Posted January 22, 2007 Look at AdlibEnable()I'll take a look at AdlibEnable. I'm still interested in knowing how to trap theerror code from any function call, while gettingthe returned value/data from the function.Any ideas ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2007 Share Posted January 22, 2007 This code looks for a popup window that may or may not display, for valid reasons.It clicks thru the window if it does come up,or keeps going down the code, if it does not display.How can I trap for an unexpected error as wellas the value returned by the function ? The "signonwrong" is a test because if the windowdisplays, it should NOT find the "SignOn" button that is in fact there,and should NOT send an ENTER.$error = WinwaitActive("Display Form","SignOnwrong",5) If $error = 0 Then Send("{ENTER}") Else ContinueCaseEndIfHow about:If WinwaitActive("Display Form","SignOnwrong",5) Then Send("{ENTER}") Else ContinueCase EndIfNote that WinWaitActive() waits for the window to have focus, not just exist. That may or may not be what you intended. WinWait() might be better. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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