I have two variables that can either be true or false on the database for the presence or absence of some product ID This is done by query.
Now I need to set another variable that will be true or false. This will be the correct value when both variables are correct or both will be false. This wrong value of one will be true and the other is false.
Currently I keep using this statement
if (v1 == true & amp;; v2 == true) result = true; Else if (v1 == incorrect & amp; v2 == wrong) result = true; Else if (v1 == true & amp; v2 == incorrect) result = false; Else if (v1 == incorrect & amp; v2 == true) result = false; Is there a better way to do this?
I miss something very original, but I let it go:
result = (v1 == v2);
Comments
Post a Comment