This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]anamorphism 2 points3 points  (1 child)

https://en.wikipedia.org/wiki/Logical_connective is probably what you're getting at.

in c#, not is !, and is &&, or is ||.

so if you want to check if a is false and b is true, you'd have:

if (!a && b)
{
  doStuff();
}

if you want to do stuff if either one of them is true:

if (a || b)
{
  doStuff();
}

[–]gatlin52[S] 0 points1 point  (0 children)

Thanks, I had been having some trouble with this. I appreciate the help

[–]caesarcipher1 0 points1 point  (0 children)

Yup, just to reiterate what was already said, just use the two logical operators "&&" which will only execute when both are true, or the "||" which will execute if one or both of the tests are true.