Jump to content

Recommended Posts

Posted

Since I cannot post in the Examples-section, have my script here.

It maps exit code numbers to error descriptions. You need the attached text file (unzipped) in the same folder as the script. I copy-pasted the descriptions from a web page. You might want to look for your localized ones.

func exitmsg($exitcode)
    $file = fileopen("exitmsg.txt", 0)
    if $file = -1 then 
        msgbox(0, "Error", "Cannot read file exitmsg.txt")
        return $exitcode
    EndIf
    
    while true 
        $line = FileReadLine($file)
        if @error = -1 Then return $exitcode
            
        $firstblank=StringInStr($line, " ")
        if stringleft($line, $firstblank) = $exitcode then return stringtrimleft($line, $firstblank)        
    WEnd
    
EndFunc

Parsing the description file only takes fractions of a second for a single lookup, but if you need to batch-convert exitcodes better read it in once...

You can also include the exitmsg.au3 in your scripts and just call the function.

Enjoy the errors!

exitmsg.zip

exitmsg.au3

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.
×
×
  • Create New...