Hello everybody,

I have yet another problem I am not sure about why it occurs.
I have the following code-example:

Quote:

function calculate()
{
wait(1);
return (vector(100,200,300));
}



function main()
{
VECTOR* the_endresult = calculate();

if (the_endresult.x == 100 & the_endresult.y == 200 & the_endresult.z == 300)
{printf("Works");}
}



I just want to return a vector, but as long as the wait(1);-command exists, this whole code does not work.
In my actual (much longer code) I have a while-loop in my return function (which contains wait-commands) so I can't leave them out.
But only 1 single wait-command and the return-function won't work.

I also don't want to globally save my numbers because this function might be opened multiple times at the same time with different numbers to work with, so a global variable would be overwritten by all functions and that might cause weird results.

Is there any good way I can still return my Vector?