Sign in to follow this  
Followers 0
aviaf

Skip a portion of code if a statement is satisfied without If statement

5 posts in this topic

I was thinking of using goto,but sinc ethat doesn't exist, is there any way to skip a large chunk of code if a condition is satisfied without using an IF Then Else EndIf?

Just because the chunk I'm skipping is pretty big and I'll have to indent everything one tab further in between, right?

Share this post


Link to post
Share on other sites



Just because the chunk I'm skipping is pretty big and I'll have to indent everything one tab further in between, right?

Nope, the indenting is only for looks and readability


Share this post


Link to post
Share on other sites

Also "you" don't have to indent your own code, press Ctrl+T in SciTE and watch the magic unfold :huh2:

Share this post


Link to post
Share on other sites

My opinion... use

If $bla = true Then
    _DefaultFunction()
Else
    _AlternativeFunction()
EndIf
Func _DefaultFunction()
    msgbox(0,"Whaaja", "Everything is gona be all right")
EndFunc
Func _AlternativeFunction()
    msgbox(0,"oops","Alternative way")
EndFunc

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks monoscout999, that's what I ended up doing, works perfectly. Cleaner too.

Edited by aviaf

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