Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Possible if statement bug

Author
Message
NoUJoe
11
Years of Service
User Offline
Joined: 8th Jul 2013
Location:
Posted: 1st Oct 2013 02:30
The code



does not print anything.

Make the values equal:



and it prints.

Is this the same for anyone else? I am still only on the trial.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Oct 2013 08:10
It works as per it's implementation. Since the and operator is performing a mask between the two sides. It's expecting that both sides (when used in this context after an IF) are going to be the result of some comparison. But they're not here. So we're ANDing's the raw bit patterns together.

The AND rule shows us that a bit is only retained only when it's present in both sides. So the expression 2 and 4 will result in zero. The IF statement will treat this as a failed match and skip the over the IF/ENDIF block and continue on.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Oct 2013 13:52
If you're wanting both parts of the statement to be evaluated as true in the manner in which I think you were expecting, then:



Login to post a reply

Server time is: 2024-11-24 19:42:58
Your offset time is: 2024-11-24 19:42:58