SA-MP Forums Archive
CASE HELP!!! - 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)
+--- Thread: CASE HELP!!! (/showthread.php?tid=473362)



CASE HELP!!! - Nadim - 02.11.2013

You can use letters in cases?

E.g.

Код:
swith(function)
{
     case a: function;
     case b: function;
     case c: function;
}
? ? ?


Re: CASE HELP!!! - Keyhead - 02.11.2013

Look at this.

https://sampwiki.blast.hk/wiki/Control_Structures#switch_2


Re: CASE HELP!!! - Konstantinos - 02.11.2013

Yes, you can use letters but not like that. By adding the letter inside ''

example:
pawn Код:
case 'A' .. 'Z': printf("The character is between A-Z");
case 'a' .. 'z': printf("The character is between a-z");
case '0' .. '9': printf("The character is between 0-9");
default: print("Not a valid character");