Sign in to follow this  
Followers 0
EddCase

Stop A Function early

2 posts in this topic

It's probably so obvious i'll cry been trying this for the last hour or so and I cant find anything in search that quite fits.

at this point if the value is -1 i'd also like the rest of the func to stop and not continue down the code any way to do this?

if $search = -1 then Msgbox(0, "No Files", "Unable to find any Cd Images")

Func GOClicked()
;Mount First CDimage
$CDPath2 = GUICtrlRead ($CDPath)
                    FileChangeDir($CDPath2)
$search = FileFindFirstFile("*.nrg")
if $search = -1 then Msgbox(0, "No Files", "Unable to find any Cd Images")
$file = FileFindNextFile($search)
        $CDPath2 = GUICtrlRead ($CDPath)
$Alcohol = '0: /M:"' & $CDPath2 & '\' & $file & '"'
ShellExecuteWait ( "C:\Program Files\Alcohol Soft\Alcohol 120\AxCmd.exe",$Alcohol);the file location could be added by a variable if added to the gui
; Close the search handle
FileClose($search)

EndFunc

Share this post


Link to post
Share on other sites



Return

It's used in the majority of the examples in the help file. Read it.

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