Sign in to follow this  
Followers 0
mcfr1es

Little Probelem - Quick Question

5 posts in this topic

#1 ·  Posted (edited)

in a certain part of my script, I have a function that is set up like so:

Func 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 by mcfr1es

Roger! You son of a big pile o' Monkey Nuts.

Share this post


Link to post
Share on other sites



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

#3 ·  Posted (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 by mcfr1es

Roger! You son of a big pile o' Monkey Nuts.

Share this post


Link to post
Share on other sites

FYI, it's:

return

Share this post


Link to post
Share on other sites

Actually, any of the following are valid:

Return

Return value

Return(value)

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