diikee Posted August 11, 2008 Share Posted August 11, 2008 $oForm = _IEFormGetObjByName ($oIE, "myform") $fr = _IEFormElementGetObjByName ($oForm, "mine") $frop = _IETagNameGetCollection($fr, "OPTION") For $fro in $frop If ($fro.innerText) = "180" Then _IEFormElementOptionselect($fr, "180", 1, "bytext") Sleep(2000) ExitLoop EndIf Next Sleep(3000)$fr = _IEFormElementGetObjByName ($oForm, "mine") ;------->>>>What if it doesn't exists, how do I exit with a nice comment and continue with the script execution instead of stopping the test?? Link to comment Share on other sites More sharing options...
Leighwyn Posted August 11, 2008 Share Posted August 11, 2008 If you look at the documentation for the function (check your Include folder, with the IE.au3 file), you'll see the following in the function notes: @ERROR - 0 ($_IEStatus_Success) = No Error - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type - 7 ($_IEStatus_NoMatch) = No Match So you'll want to look at the error value after calling the function, which you can do through the "@error" macro. Just check what its value is, and then you can branch accordingly in your program. Link to comment Share on other sites More sharing options...
diikee Posted August 11, 2008 Author Share Posted August 11, 2008 thanks Leighwyn....I should have seen that Link to comment Share on other sites More sharing options...
oren Posted August 11, 2008 Share Posted August 11, 2008 I cant really understand?? My question is if you run a function and if it a error how do you make it to continue the script and not existing on the error? Link to comment Share on other sites More sharing options...
DVHRLD Posted September 14, 2008 Share Posted September 14, 2008 I cant really understand?? My question is if you run a function and if it a error how do you make it to continue the script and not existing on the error?Sorry this is a little delayed but If you are still looking for a solution try this If @error Then ;look for form again?? EndIf I am no pro at coding so it is just a suggestion, no guarantees it will work. AutoViewer first public AutoIt script Link to comment Share on other sites More sharing options...
ludocus Posted September 14, 2008 Share Posted September 14, 2008 (edited) you need to put this at the top of your script: _IEErrorHandlerRegister() Edited September 14, 2008 by ludocus 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