[Tutorial] Switch & If/else
#7

May also be worth noting that in some cases the if statement is actually better. For example:

pawn Code:
if(Cash >= 1500 && Cash <= 8000)
{
    // do whatever
}

switch(Cash)
{
    case 1500..8000:
    {
        // do whatever
    }
}
In this case because of the huge range, the if statement is better than the switch.
Reply


Messages In This Thread
Switch, If/else & Static - by [WA]iRonan - 15.01.2014, 16:52
Re: Switch & If/else - by Diesel5 - 15.01.2014, 16:57
Respuesta: Switch & If/else - by Swedky - 15.01.2014, 16:59
Re: Switch & If/else - by Vince - 15.01.2014, 17:00
Re: Switch & If/else - by iZN - 15.01.2014, 17:09
Re: Switch & If/else - by [WA]iRonan - 15.01.2014, 17:50
Re: Switch & If/else - by 2KY - 15.01.2014, 20:03
Re: Switch & If/else - by Zjiht - 15.01.2014, 20:09
Re: Switch & If/else - by Hansrutger - 15.01.2014, 21:16
Re: Switch & If/else - by Jimmy0wns - 15.01.2014, 21:20

Forum Jump:


Users browsing this thread: 2 Guest(s)