Switch() doesn't work at all
#9

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
of course you have to break or return each case, as it will fall through to next....

if u know how paste this code in browsers js console and see what happens

Код:
var test = function () {
	var a = 1, b = 'Nothing';

	switch (a) {
		case 1:
			b = 'One';
		case 2:
			b = 'Two';
		default:
			b = 'Unknown';
	}

	return b;
}

test();
Go and try this in PAWN:

pawn Код:
new a = 1, b[8] = "Nothing";
switch (a)
{
    case 1:
        b = "One";
    case 2:
        b = "Two";
    default:
        b = "Unknown";
}
print(b);
Reply


Messages In This Thread
Switch() doesn't work at all - by justjamie - 01.09.2016, 18:04
Re: Switch() doesn't work at all - by IFilip - 01.09.2016, 18:48
Re: Switch() doesn't work at all - by justjamie - 01.09.2016, 18:52
Re: Switch() doesn't work at all - by Vince - 01.09.2016, 19:25
Re: Switch() doesn't work at all - by CoaPsyFactor - 01.09.2016, 19:32
Re: Switch() doesn't work at all - by Stinged - 01.09.2016, 19:42
Re: Switch() doesn't work at all - by CoaPsyFactor - 01.09.2016, 20:16
Re: Switch() doesn't work at all - by AndySedeyn - 01.09.2016, 20:24
Re: Switch() doesn't work at all - by Stinged - 01.09.2016, 20:27
Re: Switch() doesn't work at all - by SyS - 02.09.2016, 07:52

Forum Jump:


Users browsing this thread: 1 Guest(s)