Sign in to follow this  
Followers 0
kut

Decoding Exitcodes

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Originele User naam ...

You can post in the Example's when you have reached 10 posts .

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


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
Sign in to follow this  
Followers 0