else if or if?
#7

I don't know if you know that so I'll explain it.
There is the possibibily to write if and else without brackets.
for example:
pawn Код:
if(statement) return 1;
else return 0;
But only the first code after the if or else will be executed. else if is used like that, it does not really exist. The following codes are exactly the same except the brackets:
pawn Код:
if(statement)
{
    //...
}
else
{
    if(statement2)
    {
        // ...
    }
}

// ========================

if(statement)
{
    //...
}
else if(statement2)
{
    // ...
}
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: 4 Guest(s)