Re: can switch work for this?



In comp.lang.javascript message <73sh551r03iguq8203mcssnvovporegvh8@4ax.
com>, Sat, 11 Jul 2009 21:07:40, Geoff Cox <gcox@xxxxxxxxxx> posted:
On Sat, 11 Jul 2009 19:07:39 +0200, Lasse Reichstein Nielsen
<lrn.unread@xxxxxxxxx> wrote:

Thanks for your reply Lasse.

x ='yes' && (a==true||b==true||c==true)

x = 'no' && a==true
x = 'no' && b==true
x = 'no' && c==true

What if x=='no' and both a and b are true? Can you say something about
the possible combinations of values?

Only one of a, b, or c can be true at any one time.

At most one, I think you mean; otherwise, most of the first quoted
statement looks unnecessary. If so, you might do better to encode their
combined state as abc = 0 (none), 1 (a), 2 (b) or 3 (c) . Then,
if (abc) tests for any one being true.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
.



Relevant Pages


Loading