Jump to content
Sign in to follow this  
jbennett

End Function early if NO exists in .ini file

Recommended Posts

jbennett

Hi everyone,

I've got this piece of code that checks if NO exists in an .ini file ad if it does the function will end, but if it doesn't then the function will continue.

Does anyone know how I can get this to work as at the moment I seem to be getting errors. Thanks

P.S there is a good reason why I don't want to use 'exit'

Func _Perform_Daily_Backup()
    
    $perform_daily = IniRead(@scriptdir & "\Configuration.ini", _ 
"DAILY_BACKUP", "run_as_daily", "")
    if StringInStr($perform_daily, "NO") then
        Endfunc

        else
        endif
    msgbox(4096,""GREAT", "Cannot find NO",0)

endFunc
Edited by jbennett

Share this post


Link to post
Share on other sites
Pain

Func _Perform_Daily_Backup()

$perform_daily = IniRead(@scriptdir & "\Configuration.ini", _

"DAILY_BACKUP", "run_as_daily", "")

If StringInStr($perform_daily, "NO") Then

; do nothing

Else

Msgbox(4096,"GREAT", "Cannot find NO",0)

EndIf

EndFunc

Share this post


Link to post
Share on other sites
zerobazar

You may also replace the first "Endfunc" by "Return"

Check in the help file.

Share this post


Link to post
Share on other sites
jbennett

Thanks that's brilliant ;-)

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  

×