Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Evaluation for AND OR Post Reply Post New Topic
Author Message
TokyoAnt
Newbie
Newbie


Joined: 16 Feb 2007
Online Status: Offline
Posts: 30
Quote TokyoAnt Replybullet Topic: Evaluation for AND OR
    Posted: 30 Mar 2007 at 12:33am
Hi,
 
For an OR statement, when does the evaluation occur? After the first value or the second? In 'C' terminology, is OR equivelant to '|' or '||' 
 
conversely, is AND in Crystal equivelant to '&' or '&&' ?
 
My question arises from a conditional statement which wasn't working as expected (not that it's directly related to the above Q but it got me thinking). e.g.
(simplified)
if (x = x)  or (x = y)   where x = 1; y = null
 
should return true as one of the two conditions are met, but in my case, it returned false.
 
What's up with this!?
 
Cheers!
Ant 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 30 Mar 2007 at 9:20am
Crystal Reports boolean operators are the C equivalent of && and ||.  The & and | in C are bitwise operators and Crystal Reports doesn't do this. Re your question about the function that didn't work as expected, I think something else is going on behind the scenes that would cause it to not act as you expected. More research would have to be done.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
TokyoAnt
Newbie
Newbie


Joined: 16 Feb 2007
Online Status: Offline
Posts: 30
Quote TokyoAnt Replybullet Posted: 30 Mar 2007 at 7:12pm

I see, Thanks Brian,

So in that case, when using Crystal, AND would evaluate on the second condition & OR would evaluate on  the first, unless the first returns false.
 
As for my issue, I'll dig deeper.
 
Thanks Brian
 
ant
 
IP IP Logged
TokyoAnt
Newbie
Newbie


Joined: 16 Feb 2007
Online Status: Offline
Posts: 30
Quote TokyoAnt Replybullet Posted: 30 Mar 2007 at 7:16pm
Actaully, on the subject Brian, you wanted constructive critiscism about your book? Well I have your Crystal reports for .NET. S fine book & literally taght me all I know about CR, yet when I used it as reference on this point I could find nothing on these boolean operators. If I'm wrong, you didn't include this information. As a constructive suggestion, I'd like to see this covered in your Encylopadea if it is not already.
 
Just trying to help outThumbs%20Up
 
Cheers
 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.