What's difference between these ?
#1

What's difference between this ..
pawn Код:
case 17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,60:
and This:
pawn Код:
case 17 .. 60:
Reply
#2

Quote:
Originally Posted by AnonScripter
Посмотреть сообщение
What's difference between this ..
pawn Код:
case 17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,60:
and This:
pawn Код:
case 17 .. 60:
Nothing different, just a shorten version of the other code, they work the same, I am not really sure about speed, but nothing is different on those code.
Reply
#3

Insted of doing the whole numbers, for example

case 1,2,3,4,5,6,7,8,9,10:

You can short it so it would run the same as above /\

case 1 .. 10:

It basicly says, if the number is from 1 to 10 including 1 and 10. Then do this.

You can also do this with it(examples):

Quote:

case 0 .. 10:
case 0,1,2,3,4,5,6,7,8,9,10
case 0 .. 1, 2, 3, 4, 5 .. 10

You can play with it as you please.
Reply
#4

thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)