Jump to content

Stop A Function early


Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...