Henrik Posted July 7, 2005 Share Posted July 7, 2005 The @error code is only valid until the next function is calledI need to know precisely what 'valid' means.If @error must be inspected after a function call, is it then good practice to call SetError(0) before the call ?If I understand correctly, a function may set @error:AFunction() AnotherFunction() func AFunction() SetError(42) endfunc func AnotherFunction() endfuncWhat will happen if @error is referenced after these 2 function calls? Does @error contain the value 42? Or is it invalid in another sense?Disclaimer: Yes, I tried both RTFM & forum search, but got no wiser. And of course I could experiment , however I think this issue ought to be clarified in the helpfile. Ignorance is strength. Link to comment Share on other sites More sharing options...
buzz44 Posted July 7, 2005 Share Posted July 7, 2005 (edited) Disclaimer: Yes, I tried both RTFM & forum search, but got no wiser. And of course I could experiment , however I think this issue ought to be clarified in the helpfile.<{POST_SNAPBACK}>The help file is clear and it state's exactly what should happen. Please be able to support your above qoute next time by actually reading the help file .From the help file... > SetError ()When entering a function @error is set to 0. Unless SetError() is called, then @error will remain 0 after the function has ended. This means that in order for @error to be set after a function, it must be explicitly set. This also means you may need to backup the status of @error in a variable if you are testing it in a While-WEnd loop. Edited July 7, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Henrik Posted July 7, 2005 Author Share Posted July 7, 2005 When entering a function @error is set to 0Thanks, exactly what I needed to know.Please be able to support your above qoute next time by actually reading the help file .<{POST_SNAPBACK}>The helpfile I read came with the v3.1.1 AutoIt installation. In the future, I'll make sure to check both the released & the latest beta version of the helpfile. Then, if there are differences, I might ask on the forums whether the helpfile changes are clarifications or reflect actual changes between the release and the beta versions of AutoIt. Ignorance is strength. Link to comment Share on other sites More sharing options...
buzz44 Posted July 7, 2005 Share Posted July 7, 2005 Ah np. For some reason I alway's assume that everyone is using a beta :"> . qq Link to comment Share on other sites More sharing options...
Henrik Posted July 7, 2005 Author Share Posted July 7, 2005 As my customer is going to use my scripts after I've left the building, I prefer to use the release version. Ignorance is strength. Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 7, 2005 Administrators Share Posted July 7, 2005 As my customer is going to use my scripts after I've left the building, I prefer to use the release version.Wise. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Henrik Posted July 7, 2005 Author Share Posted July 7, 2005 Wise. <{POST_SNAPBACK}>May I quote you on that? Ignorance is strength. 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