SA-MP Forums Archive
Case # through #? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Case # through #? (/showthread.php?tid=65989)



Case # through #? - DeerHooves - 18.02.2009

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


Re: Case # through #? - Cueball - 18.02.2009

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~



Re: Case # through #? - DeerHooves - 18.02.2009

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:".