vec_set() syntax error... Can you spot it?

Posted By: Carlos3DGS

vec_set() syntax error... Can you spot it? - 01/07/12 14:51

can anyone spot what is wrong with the following vec_set() instruction?:
Code:
VECTOR vec_n;
vec_set(vec_n, vector(random(500) -250, random(500) -250, random(500) -250);


-added parenthesis around "random(500) -250" but that didn't fix it.
-substituted "vec_n" for "vec_n.x" but that didn't fix it either.

I get a "sytax error" for that vec_set instruction


I have avoided the problem subtituting the "vec_set" instrucion with this:
Code:
vec_n.x=random(500) -250;
vec_n.y=random(500) -250;
vec_n.z=random(500) -250;


But I am still curious why that instrucion gave a syntax error...
Can any of you experts spot it?
Posted By: WretchedSid

Re: vec_set() syntax error... Can you spot it? - 01/07/12 15:08

Your forgot the closing paranthesis for vec_set wink
Posted By: Carlos3DGS

Re: vec_set() syntax error... Can you spot it? - 01/07/12 15:10

OMG... looked at it so many times and didn't spot that. I feel soooo dumb right now, seems I can't count parenthesis today! Sooooooo stupid!
Posted By: WretchedSid

Re: vec_set() syntax error... Can you spot it? - 01/07/12 17:42

Originally Posted By: Carlos3DGS
I feel soooo dumb right now, seems I can't count parenthesis today! Sooooooo stupid!

Don't feel stupid, these things happen more often to everyone than you'd might think. It actually is a problem of the IDE that you are using, SED doesn't show the parenthesis pairs. For example, in Xcode and TextMate (sorry, these only work on OS X and I have no Windows example), going over a closing parenthesis will highlight the opening one.
Still, these problems happen. Its usually a good idea to ask someone or just wait a day or so and look again.
© 2023 lite-C Forums