17.03.2013, 08:29
switch:
A switch statement is basically a structured if/else if/else system (similar to how for is a structured while). The easiest way to explain it is with an example:
A switch statement is basically a structured if/else if/else system (similar to how for is a structured while). The easiest way to explain it is with an example:
pawn Код:
new
a = 5;
switch (a)
{
case 1:
{
// Won't be called
}
case 2:
{
// Won't be called
}
case 5:
{
// Will be called
}
default:
{
// Won't be called
}
}