The ternary operator (eg, "1?2:3") is pretty interesting, but it's a shame that it generates an error when the expression that is never intended to be executed gets executed anyway. For example:
In the above example, if the variable ErrorCount is empty, you would think that this code would return the value 1, but instead this code returns an error, because the final operand of the ternary operator, which should not be executed in this case, is expecting a number but there is no number.
Consider this alternative example:
In that example, the second Return action does not throw any error if ErrorCount is an empty string. This is the same logic, but with a totally different result (ie, no failure.)
This difference in behaviour means that the ternary operator is harder to use, because its evaluations could result in errors even when I don't want the evaluations to occur.
There are ways I can work around this problem, but I can't imagine any scenario in which the absence of evaluating a calculation that is irrelevant could harm anyone's macro.
Therefore I request that any part of the ternary operator that is never executed should never be evaluated. But I know most of my requests aren't adopted, so I would recommend that in any case the ternary operator's behaviour be documented in the wiki.
May I point out that in all other languages that I've googled, (C, C++, Java, Javascript, C#, Python, Ruby, PHP, Swift) they use "short-circuit logic" which prevents the unused operand from being executed. KM's behaviour appears to differ from all these languages. Perhaps KM's ternary operator should work the same way.