mcfr1es 0 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. Share this post Link to post Share on other sites
Valik 478 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. Share this post Link to post Share on other sites
mcfr1es 0 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. Share this post Link to post Share on other sites
SlimShady 1 Posted September 6, 2004 FYI, it's: return Share this post Link to post Share on other sites
Valik 478 Posted September 6, 2004 Actually, any of the following are valid:ReturnReturn valueReturn(value) Share this post Link to post Share on other sites