proc/SomeProc()
var/someVar=0
spawn()
while(true)
sleep(5)
world << someVar
someVar=1
while(true)
sleep(5)
world << someVar
This code will produce output alternating between 0 and 1. The only thing that I can imagine is that spawn() actually creates two different someVar variables, which is somewhat frustrating. I was trying to use a variable to ensure that both halves of the spawned code had finished before I did something else, but I couldn't figure out why, until I noticed this.
More info can be found here:
http://www.byond.com/docs/guide/
Section: The Life of a Variable
ts