boolean over multiple variables
BCS
none at anon.com
Fri Jan 22 14:04:28 PST 2010
Hello Strtr,
> This may be is a very basic question, but is there a way to let me
> omit a repeating variable when doing multiple boolean operations?
>
> if ( var == a || var == b || var == c || var == d) if ( var == (a || b
> || c || d) )
>
bool B;
switch(var) { case a,b,c,d: B = true; break; default B = false; break; }
if(B)
or you can put the then/else parts right in the switch
More information about the Digitalmars-d-learn
mailing list