Switches & Cases!
#1

How to make 'else' function under switches?

pawn Код:
switch(something)
{
    case 0: text = "something";
    case 1: text = "something";
    else ...
}
Reply
#2

You can't. But you can use this:
pawn Код:
switch(something)
{
    case 0: text = "something";
    case 1: text = "something";
    case 2..10: text ="change 10 to the last possible value of your variable";
}
Reply
#3

I'm not sure if this is what you mean, but default will work as else.

pawn Код:
switch(something)
{
    case 0: text = "something";
    case 1: text = "something";
    default: text = "Nothing from the above";
}
Reply
#4

Default is like else
pawn Код:
switch(something)
{
    case 0: text = "something";
    case 1: text = "something";
    default: text = "something";
}
EDIT: too late
Reply
#5

Worked! Thanks all..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)