Jump to content

Exit 1 reserved  

12 members have voted

  1. 1. Should a standardized exit code be advised/promoted ?

    • YES: It makes sense to uphold basic meaningful Exit codes
    • NO: An exit error is an exit error. Stop this nonsense !


Recommended Posts

Posted (edited)

I was looking at an example and it would Exit 1 on error.
So what's wrong with that. Well, we can get an error from different aspects of the script, been the stub errored, or the wrapper errored, or finally, the script.
What I propose is to start script errors on 3 onwards. Been 1 the error of AutoIt3, 2 of the wrapper, and finally the script.

If you agree vote for me: "argumentum 2021" :D

Really, if the concept is sound then say it and if not ... well, say it too  :gathering:

PS: this is in regard to Exit codes of a script and not that of Return in a Function.

Edited by argumentum
clarification
Link to post
Share on other sites

I agree with you, the commonly used exit codes should not be used by the interpreter itself when the script is executing. I'd propose something like reserving a range of exit codes after a large value like 1024...

I will have to think about this too when I finally get around to working on executing code in ECI ;)

EasyCodeIt - A cross-platform AutoIt implementation

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Graeme
      Hi,
      I have a problem in that one script runs successfully and gets to this line
      MsgBox(0x40,$UpdateID,"Successfully installed update " & $UpdateID) Exit(1) This script was started by another at this point:
      $InstallationResult = RunWait($ExeFileFullPath & " " & $InstallerParameters)                     ProcessWaitClose(StringReplace($FileName,"mmupdate","exe"))                     SplashOff() If $InstallationResult = $DesiredResult Then FileMove($ExeFileFullPath, $FileFullPath & ".done")    LogWrite("Update succeeded") Else                         ; the update failed... oh dear what shall we do?    If 1 = MsgBox(0x21,$PrettyScriptName,"The update failed to install - try again another time?") Then    FileMove($ExeFileFullPath, $FileFullPath)    LogWrite("Update failed - will be retried on next launch")                               Else      FileDelete($ExeFileFullPath)      LogWrite("Update failed - deleted by user request")                                EndIf EndIf I had two problems - first
      I had to put the processwaitclose in because otherwise the program would go onto the "update failed" msgbox before getting to the "update was successful" msgbox!
                                      second
      even with the processwaitclose it gives the $installationResult as 0 not 1 even though when it finally finished the first script the exit code must have been 1 as that follows after msgbox which shows?
      Any ideas? Is it possible that 2 exit codes are produced??? Is it possible for $installationResult to be set before the program finishes?
      Blessings
      Graeme
×
×
  • Create New...