Yeah that came to my mind after posting here, I mean how the code is executed and why this causes these results.
Ok one question though doug:
How about adding a while loop to check if the called function has already returned a value:
Code:

function gimme_a_return()
{
wait(-1);
return(2);
}

function test_return()
{
var i;
i = gimme_a_return();
while(!i) { wait(1); }
//do stuff with i
}



This seems not to work either, and I mean its pretty logic I guess.
I already made the workaround with the global vars wasn't a problem at all, just liked the idea to return a value to check if the function failed or what it worked out.

thanks
Thunder