guysmilie Posted August 1, 2009 Share Posted August 1, 2009 Excuse me if this has been answered elsewhere, I did do a quick search, but did not find the answer. Is there a simple way to have a step/line in a script "retry" a number of times if it fails the first time? Thanks in advance to anyone who can help, Guy. Link to comment Share on other sites More sharing options...
boogieoompa Posted August 1, 2009 Share Posted August 1, 2009 Are you talking about in the script or while running the script thru an editor? If the later it depends on the editor but some have a built in function where it shows you where the script failed and allows you to re-run that section. However I assume you mean the former in which case wouldnt... ;somefunction If (@error) Then ;repeat said function EndIf Be kind of what your looking for? Many autoit functions set @error when it encounters a problem. If you are not talking about a script error than replace teh (@error) with some manditory variable aka <>0 or whatnot. Unless'm totally missing the mark. Link to comment Share on other sites More sharing options...
guysmilie Posted August 2, 2009 Author Share Posted August 2, 2009 Thanks for your reply. I am totally new at this. I will research the set @error you mentioned. Do you happen to know if the function ControlClick does this? I am assuming the idea is to use a loop if @error = 0/1, repeat loop? Thanks for your help, much appreciated, Guy. Are you talking about in the script or while running the script thru an editor? If the later it depends on the editor but some have a built in function where it shows you where the script failed and allows you to re-run that section. However I assume you mean the former in which case wouldnt... ;somefunction If (@error) Then ;repeat said function EndIf Be kind of what your looking for? Many autoit functions set @error when it encounters a problem. If you are not talking about a script error than replace teh (@error) with some manditory variable aka <>0 or whatnot. Unless'm totally missing the mark. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 2, 2009 Share Posted August 2, 2009 Do you happen to know if the function ControlClick does this?The only way to know that for sure is to open your helpfile, browse to the function you're interested in and look at the "Return Value" section. It will list any Return and/or Error values you can use to check for error/success. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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