ID:160671
 
I've seen it used before, but I can't find any documentation of it in the reference. Can anyone tell me how it works exactly?
It's a shorthand keyword for for():
for(var/i = 1 to 5 step X) //X default 1
//equivalent:
for(var/i,i < 5,i += X)


And it's a possible syntax in switch():
switch(Val)
if(3 to 5)
world << "3, 4 or 5"


(It's never really a statement, it's a part of another statement)
In response to Kaioken
Ah, thankyou for clarifying all that. I've seen it used in for() loops before, and attempted to use it myself. I'm not sure if I used it right exactly though, it doesn't really look like yours, either. Would this work properly?

for(var/X in 1 to 2) //it produces no compiler errors
In response to Jeff8500
It might, but that'd be the same syntax as I posted. If I had to take a guess I'd say it wouldn't work, but that's not really important.
In response to Jeff8500
That works fine.

mob/verb/test_1to2()
for(var/X in 1 to 2)
usr << X


Output:
1
2