ID:159432
 
spawn(Delay=0) Statement

proc/Kill(mob/m) Statement?
Should be obvious if you apply enough thinking. Then again it should also be to be more descriptive than only giving one somewhat ambiguous line to explain your question, which I'm taking a guess at. :P
mob/human
var/age
New()
src.GrowOld()
src << "You're a new human."
proc/GrowOld()
spawn()
for()
if(++src.age > 100)
src << "You die of old age."
del src
sleep(1337)

This makes the GrowOld() proc return almost immediately whenever called, queuing up its main body code to run later. This is of course better to use than spawn()ing each and every call with procs that generally act as a process that takes time and there is no benefit in (or desire that) the proc caller waiting until that process finishes. You could use -1 as the spawn() delay if you wish the spawned code to execute as soon as possible. Misc note: some built-in DM instructions work in this same manner, for example walk() and flick().
In response to Kaioken (#1)
mob/human
var/age
New()
src << "You're a new human."
src.GrowOld() {src << "You've a died old man.";src.loc=locate(0,0,0)}
//thats what i meant by spawn like calling a statement after the proc returns
proc/GrowOld()
while(++src.age < 100)sleep(1337)


kinda like that.

*Edit*
Well not quite but.. because for that you can call it afterwords...

Okay leme just say what im trying to do. Im trying to make a custom spawn with different params, but the only problem is it cant add the statment part to it it thinks its a label.

#define Spawn(x) MySpawn(x,30)

proc/MySpawn(Delay,range) Statement
spawn()
Delay*=range/10
spawn(Delay) Statement

that doesn't work it thinks Statement is a label
In response to Tubutas (#2)
mob/human
var/age
New()
src << "You're a new human."
spawn src.GrowOld()

proc/GrowOld()
while(++src.age < 100)sleep(1337)
src << "You've a died old man.";src.loc=locate(0,0,0)
//So when the while loop stops it will say you have died, same thing as returning without the hassle

In response to Bakasensei (#3)
Yes i said thats how you could do it but thats not what i want :O. I need it so you can call a statement (like world<<1) at the end of the proc, and the statemnet is gonna be dynamic so there's no simulating it.

in that case...
src.GrowOld() src<<"You've died old Man"
src.GrowOld() src<<"You've been given a new chance at life"
src<<"Welcome you Whippersnapper"

once again don't get caught in the details, but thats kindoff what i want.
In response to Tubutas (#2)
I'd be surprised if it thought it was anything else, seeing as you're using a nonexistent syntax there, so it just takes it as a random word (which it is, it's no special DM word) for a label name. DM does not work like this; you can't arbitrarily say Statement and expect it to work how you want - you can't even add new instructions that take blocks of code indented under them in the first place. Only special constructs can do that, not your own procs. There's not really a need for it, anyway. For one, you could use a #define in place of a direct spawn():
#define MySpawn(D,R) spawn(D*R/10)
In response to Kaioken (#5)
I've been going at it backwards!! wow that makes so much sense :O. Thanks.