Jump to content

SOLVED -- Breaking out of a function


StooJ
 Share

Recommended Posts

I have a script with few functions included. However, sometimes for some reason or another they won't work, depending on the PC.

Is there a way of breaking out of the function? I want to get out of the function, but not out of the whole script.

If $Test = False Then
    ExitFunction
EndIf
Lots of other stuff
If $Test2 = False Then
    ExitFunction
EndIf
More stuff
EndFunc

I realise I could maybe nest the whole thing in an If statement, but there are several unrelated conditions that might cause the function to fail, & they occur at several seperate sections throughout the function so I can't really see how it would nest.

Sorry if I'm missing something obvious here. Thanks for your help.

-----------EDIT------------

Really sorry about this. I just tried using the Return command and it worked a treat.

Edited by StooJ
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...