eagle51 Posted January 10, 2007 Posted January 10, 2007 Hello guys, is there something like If(WinWaitActive("Information", "Fehler aufgetreten")) Then Call("Terminate2") EndIf I need to find out whether an error-message appeared or not Thanks eagle51
Valuater Posted January 10, 2007 Posted January 10, 2007 maybe... If(WinWaitActive("Information", "Fehler aufgetreten")) Then Call("Terminate2") ; or If(WinWaitActive("Information", "Fehler aufgetreten")) Then Call("Terminate2") ; do other things EndIf 8)
xcal Posted January 10, 2007 Posted January 10, 2007 Just add a timeout to winwaitactive and check the return value of it. How To Ask Questions The Smart Way
herewasplato Posted January 10, 2007 Posted January 10, 2007 (edited) Call ? For shame... :-) Edit: Sorry, inside joke - you do not need Call. BTW, Welcome to the forums. You can make you script to handle all of the "normal windows" and use the adlib function to handle errors. Edited January 10, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
eagle51 Posted January 10, 2007 Author Posted January 10, 2007 If(WinWaitActive("Information", "Fehler aufgetreten")) Then Call("Terminate2") ; do other thingsEndIfDoesn't work @here: I don't understand @all:The problem is... My script is deleting a bunch of entries in a database.In the begining the user being asked how much entries he want to delete. If he enters "-1", the script will delete all.When the last entry is deleted a message appears. Therefore I need the "If".....Sorry for my bad english
xcal Posted January 10, 2007 Posted January 10, 2007 If I'm getting you right, all you need to do is... WinWaitActive("Information", "Fehler aufgetreten") ;this will pause the script until the window is active Terminate2() You may also want to do something like this instead... (this will wait until the window exists so doesn't need to be active, necessarily) ;code etc Do Sleep(100) Until WinExists("Information", "Fehler aufgetreten") Terminate2() How To Ask Questions The Smart Way
Helge Posted January 10, 2007 Posted January 10, 2007 @here: I don't understand When you know the function to call at the time you write the script there's no reason at all to use Call, meaning when you pass it just a string and no variables, macros, expressions or whatever, it is just meaningless to use it. Let us say that we have three functions, and we want the script to randomally call one of them. This is where Call is useful... We use the string "myfunc" with a number returned by Random : Call("myfunc" & Random(1, 3, 1))oÝ÷ Øü¨º;¬·§¶ÚjYfÉû§s[az··öÉè¨"r·ªº*ÞvÊ2¢ç;¬µÚè¤&¥Ê&¦WzºÚ"µÍ^Y[ÌJ
eagle51 Posted January 11, 2007 Author Posted January 11, 2007 (edited) Thanks for helping guys @helge, now I understand @xcal (this will wait until the window exists so doesn't need to be active, necessarily) That's wrong... The message can appear, but it doesn't have to. The code should look something like this: If WinExists("Information", "Fehler aufgetreten") Then ;Code...... msg... etc... terminate2() EndIf But this code - as already known - doesn't work Edited January 11, 2007 by eagle51
xcal Posted January 11, 2007 Posted January 11, 2007 (edited) If he enters "-1", the script will delete all. When the last entry is deleted a message appears. Ask yourself, under what condition will that window appear? If the user enters '-1'! So maybe... If $userinput = '-1' Then ;not sure if -1 is a string or not Do Sleep(100) Until WinExists("Information", "Fehler aufgetreten") Terminate2 () EndIf edit - forgot the terminate2 function Edited January 11, 2007 by xcal How To Ask Questions The Smart Way
eagle51 Posted January 11, 2007 Author Posted January 11, 2007 (edited) @xcal , yes that will work, but the script will do nothing till the window with the message appear, right ? The point is... imagine something like this: For x = 0 to 100 Send("!s") Send("Test") Send("{Enter}") ; HERE THE WINDOW CAN APPEAR WITH THE MESSAGE Next Edited January 11, 2007 by eagle51
xcal Posted January 11, 2007 Posted January 11, 2007 The point is... imagine something like this: For x = 0 to 100 Send("!s") Send("Test") Send("{Enter}") ; HERE THE WINDOW CAN APPEAR WITH THE MESSAGE ;THEN PUT AN IF WINEXISTS HERE Next How To Ask Questions The Smart Way
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