Jump to content
  • Advertisement
Sign in to follow this  
xivVerge

Not operator

This topic is 3602 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, i've upgraded to version 2.14.1 and noticed that the not (!) operator is no longer working in if statements. I always get "Expected expression value" errors. Is it just a config thing or has the parser changed? Thanks, Tim

Share this post


Link to post
Share on other sites
Advertisement
A simple example is the following:


class Test
{
bool isTrue() { return true; }

void test()
{
if ( !isTrue() )
print("false");
else
print("true");
}
}

Test t;



I can rewrite the if statement to get it working:

class Test
{
bool isTrue() { return true; }

void test()
{
if ( isTrue() != true )
print("false");
else
print("true");
}
}

Test t;



Regards,
Tim


Share this post


Link to post
Share on other sites
Yeah that works too, but !isTrue() worked at least in version 2.13.1.
I don't know why there should be extra parenthesis necessary now.

Regards,
Tim

Share this post


Link to post
Share on other sites
I am not sure why. It is perhaps some ANSI requirement. BTW you don't specify which tool you are talking about (version 2.13.1 of what?) and the language you are using. Probably C++ ?

Share this post


Link to post
Share on other sites
Quote:
Original post by VinzO
BTW you don't specify which tool you are talking about (version 2.13.1 of what?) and the language you are using. Probably C++ ?

Give that this is the AngelCode forum, you can assume the language is AngelScript.

Share this post


Link to post
Share on other sites
Sure, sorry. I got here by clicking on
"recent threads" on the homepage. Haven't seen the forum title.

Share this post


Link to post
Share on other sites
This must be a bug that made it into the latest release. I'll have fixed a.s.a.p.

Thanks for letting me know.

Regards,
Andreas

Share this post


Link to post
Share on other sites
This bug was caused by the introduction of the !is operator. The tokenizer is incorrectly parsing the "!" "isTrue" tokens as "!is" "True", which causes the error you're seeing.

I'll have a fix for it soon.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!