mcfr1es Posted September 6, 2004 Share Posted September 6, 2004 (edited) in a certain part of my script, I have a function that is set up like so: expandcollapse popupFunc Blah For ---- For ---- If BlahBlahBlah Then If BlahBlahBlah Then If BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Endif Endif ENdif If BlahBlahBlah Then If BlahBlahBlah Then If BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Endif Endif ENdif If BlahBlahBlah Then If BlahBlahBlah Then If BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Elseif BlahBlahBlah Then xxxxxxxxxxxxx Endif Endif ENdif Next--- Next--- EndFunc I want to break out of the function if one of the "xxxxxxxxxxx" parts are reached.. I know that exitloop only breaks out of do/for/while loops I tried to use ExitLoop 2 but I dont believe it works... Am I correct on this matter (that ExitLoop 2 doesnt work) and if so what else can I use? to break out of the function Note: I know that I can combine my first two "if" statements in each group but i choose to not do so for legibility purposes Edited September 6, 2004 by mcfr1es Roger! You son of a big pile o' Monkey Nuts. Link to comment Share on other sites More sharing options...
Valik Posted September 6, 2004 Share Posted September 6, 2004 Wouldn't it be 3 loops you need to exit out of? 1 While and 2 For loops. You can always use Return if you want to just leave the function immediately. Link to comment Share on other sites More sharing options...
mcfr1es Posted September 6, 2004 Author Share Posted September 6, 2004 (edited) Mistake on my part, there is no while in my script.... changing first post now and ill use return, strangely i havent used it before: would I use it like this -> return or return() Edited September 6, 2004 by mcfr1es Roger! You son of a big pile o' Monkey Nuts. Link to comment Share on other sites More sharing options...
SlimShady Posted September 6, 2004 Share Posted September 6, 2004 FYI, it's: return Link to comment Share on other sites More sharing options...
Valik Posted September 6, 2004 Share Posted September 6, 2004 Actually, any of the following are valid:ReturnReturn valueReturn(value) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now