else if or if?
#4

Oh, sorry, I didn't notice that. The performance would be the same, though it's usually best practice to use "else if" when you know the above if statement would have to fail in order for the second one not to.

You could also just do this as there are only two possible outcomes:
pawn Код:
if (VariableSet) {
// stuff
} else {
// stuff
}
Reply


Messages In This Thread
else if or if? - by lukas567 - 11.04.2012, 12:49
Re: else if or if? - by Slice - 11.04.2012, 12:52
Re: else if or if? - by lukas567 - 11.04.2012, 12:53
Re: else if or if? - by Slice - 11.04.2012, 13:05
Re: else if or if? - by lukas567 - 11.04.2012, 13:14
Re: else if or if? - by lukas567 - 11.04.2012, 13:20
AW: else if or if? - by Meta - 11.04.2012, 14:26

Forum Jump:


Users browsing this thread: 1 Guest(s)