Warning 225: Unreachable Code [PAWN]
#7

Quote:
Originally Posted by rpg894
Посмотреть сообщение
Every "if" must be followed either by "return" or by { }. Your 1st if has neither of them.
If statements only need { if they're more than 1 line. They don't need a return, as long as they're only one line.

pawn Код:
//If it's only one function
if(Something) ThisOneFunction();
if(Something)
    ThisOneFunction();


//If it's more than one
if(Something)
{
    ThisOneFunction();
    ThisOtherFunction();
}
if(Something) {
    ThisOneFunction();
    ThisOtherFunction();
}
if(Something) { ThisOneFunction(); ThisOtherFunction(); }
All of those are valid ways to do it
Reply


Messages In This Thread
Warning 225: Unreachable Code [PAWN] (FIXED) - by DarkPower010 - 11.06.2013, 10:49
Re: warning 225: unreachable code - by rpg894 - 11.06.2013, 10:51
Re: Warning 225: Unreachable Code [PAWN] - by DarkPower010 - 11.06.2013, 10:52
Re: Warning 225: Unreachable Code [PAWN] - by rpg894 - 11.06.2013, 10:53
Re: Warning 225: Unreachable Code [PAWN] - by DarkPower010 - 11.06.2013, 11:00
AW: Re: Warning 225: Unreachable Code [PAWN] - by HurtLocker - 11.06.2013, 11:03
Re: Warning 225: Unreachable Code [PAWN] - by [ABK]Antonio - 11.06.2013, 11:03
Re: Warning 225: Unreachable Code [PAWN] - by Sascha - 11.06.2013, 11:06
Re: Warning 225: Unreachable Code [PAWN] - by DarkPower010 - 11.06.2013, 11:07
Re: Warning 225: Unreachable Code [PAWN] - by Slice - 11.06.2013, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)