Msg#: 4242513 posted 8:51 am on Dec 15, 2010 (gmt 0)
Hi there TheKiller,
I suppose that depending on the context you could have a nested ternary, could be a bit tricky, depending on what would be needed, but once the logic is sorted out I would think that an appropriately nested ternary would do the job!
They are handy things to learn especially if you want to try and covert a paragraph of code into a more digestible statement.
Msg#: 4242513 posted 4:56 pm on Dec 15, 2010 (gmt 0)
Agreed, though they can be confusing, they are also pretty useful. Sometimes having a paragraph of well structured code negates the need to condense if for 'elegance' sake - if it ain't broke, don't fix it.
Nested ternarys are just a preference of mine. I use them whenever I feel as they are the better choice in a logical way..