Neither of these can be trusted to work inside functions IMHO.

Inside functions (ie LOCAL variable) the vector should be like so.
Code:
function DoSomeThing()
{
   ...
//BADBADBAD   VECTOR target = vector(mouse_cursor.x,mouse_cursor.y,800);   BADBADBAD//
   VECTOR target;
   vec_set(target,vector(mouse_cursor.x,mouse_cursor.y,800);
   ...
}

But if you are defining it as a GLOBAL (outside a function), you should use
Code:
VECTOR* target = { x=0; y=0; z=0; }
...
function DoSomeThing()
{
   ...
   vec_set(target, vector(mouse_cursor.x,mouse_cursor.y,800));
   ...
}


Vectors are buggers to work with, I think it may be poor documentation,
or maybe Im just a bit thick. I had lots of troubles with them too.
But once you get to grips with them, its not a problem.

I expect both your examples to fail eventually because both create a pointer
to the vector() function result area, which is only a temporary data location.
Look at the remarks under the vector function in the manual.

Last edited by EvilSOB; 01/04/09 20:39. Reason: Code corrected - Tobias is right.

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial