Jump to content
Sign in to follow this  
DoctorX

Error Checking

Recommended Posts

DoctorX

$CDDir = FileReadLine ($file, 18)
    $Shortcuts = FileReadLine ($file, 21)
    $ShortDir = FileReadLine ($file, 24)
        If @error <> 0 Then
            ErrorFunc ("The data in the " & @ScriptDir & "\Data\F4DP.cfg file is missing or corrupt.", _
                "GetUserData-FileReadLine")
        EndIf

Will this check for errors on all 3 instances of FileReadLine or just the last one?


-DRX

Share this post


Link to post
Share on other sites
LxP

Only the last instance will be error-checked, but if the last call generates an error then you can probably safely bet that the first two also did.

Also, the following two lines of code are equivalent:

if @error <> 0 then
if @error then

Share this post


Link to post
Share on other sites
DoctorX

Thanks again Alex. Keep up the advice and I may have to add a co-author credit in my script! :whistle:


-DRX

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  

×