NatXotic Posted April 26, 2004 Share Posted April 26, 2004 Hi there, i'm playing with expressions a bit and i stumbled over an error in one of my expressions. "Unable to evaluate expression -(Syntax Error - extra tokens detected in expression)" I checked the number of arguments in my expression call and the defined expression and they are the same number. I checked the namings in the expression and i couldn't find an error. So where exactly do i have to look for that error? Thx, any help is appreciated. NatX edited: it would really help to find a page that describes all the common error messages Quote Link to comment Share on other sites More sharing options...
michael Posted April 26, 2004 Share Posted April 26, 2004 the 'extra tokens' thingy is usually because you have something in ' ' or " " that shouldn't be...at least that's what happens to me... can you post the expression? I'll be it's something really simple that you're just not seeing Quote Link to comment Share on other sites More sharing options...
NatXotic Posted April 26, 2004 Author Share Posted April 26, 2004 Yeah, it must be something very simple: float doorswing(float radius, float positionX, float positionZ, float thickness, float hengeDoor) { float angleDoor = 0; float disHBall = sqrt(pow(positionX,2) + pow(positionZ,2)); float decVar = sqrt(pow((hengeDoor-positionZ),2) + pow((radius+thickness),2)); float alpha = asin((radius+thickness)/disHBall); float beta = asin(positionX/disHBall); if (disHBall <= decVar, angleDoor=(alpha+beta), 0) return angleDoor; } My eyes are weiry! -lol BTW, i know it's not the best naming, but should work anyhow, don't you think so? Quote Link to comment Share on other sites More sharing options...
FrankFirsching Posted April 26, 2004 Share Posted April 26, 2004 The error is with your if-statement. Inside a custom expression you write them like you would do in C. It should look like: if(disHBall <= decVar) angleDoor=(alpha+beta); Cheers Frank Quote Link to comment Share on other sites More sharing options...
NatXotic Posted April 26, 2004 Author Share Posted April 26, 2004 ah, alright. didn't know that. Even better. Thx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.