Case # through #?
#1

is there a way other than doing case 0, case 1, case 2, case... to make it simple like case 0 through case 200 or whatever
Reply
#2

There most certainly is.
pawn Код:
case 0..200: // case 0, 1, 2 <--> 198, 199, 200.
  blah;

default: // Everything else that has no case.
  more blah;
Check pawn-lang.pdf for information about switch and case statements.

~Cueball~
Reply
#3

Quote:
Originally Posted by Cuecumber
There most certainly is.
pawn Код:
case 0..200: // case 0, 1, 2 <--> 198, 199, 200.
  blah;

default: // Everything else that has no case.
  more blah;
Check pawn-lang.pdf for information about switch and case statements.

~Cueball~
Thank you for the link, I found my answer in there, its a called a "range", done like, "case 0..200:".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)