so value3 will be true/1 and the rest will be false. However if I wanted more than one value to be true like a truth table, eg
value1 = 0;
value2 = 0;
value3 = 1;
value4 = 1;
Can you use enums to achieve this. It would be nice to define a state based on the combination of whats on/off or whats true/false as this would reduce the nasty clunky long arguments of the if statement. eg something like
I am not fond of using enum,always pictured it , perhaps foolishly , as kind of alias allowing assigning a variable (name) to a common variable ( name).
I think trying to "automate/ hide " logical conditions in any scheme is not a good idea.
So many times we see if ( a and b and c and d and e and f and g) written as
if (( (a and b) and ( c and d)) and (e and f and g)) just because it "looks logical".
I got nothing against experimenting. but some automation IMHO is a clear example of A.Cooper's "inmates are running the asylum" dancing bear.
Just because it can be done is not always the best.
And forcing enum into logical true / false is iffy.
as kind of alias allowing assigning a variable (name) to a common variable ( name).
There are 7 days a week. Doesn't "If today is Thursday" make more sense than "if today is 5"?
Or would that be 4? Depending on how you number things? Thursday is definitive, and the actual value irrelevant.