Since a lot of people are making basic mistakes in 6.40.1 there will be a new warning for incorrect use of IIF:
An attempt to use incorrect code like this
IIf( C > 2, x = 4, x = 2 ); // BAD, DON'T DO THIS!
results now with warning 511 Assignment within IIF function arguments. Use IIF() return value instead
A proper usage of IIF is always using return value that contains result of IIF evaluation for the assignment like this:
x = IIF( C > 2, 4, 2 ); // CORRECT, no assignments inside IIF arguments
A quick question for you. Do you think of better wording for the message than "Assignment within IIF() function arguments. Use IIF() return value instead"
The design rule for error messages is that first sentence always describes the problem.
Such as "syntax error" or "missing arguments" or "number expected" or "missing parenthesis" or "assignment within conditional". It does not say "you need to add parenthesis here" in first sentence. Typically hint what to fix is given in second sentence.
Was trying to keep message short.
For example in analysis if an error or warning shows up there and message is too long then (at least on my end) the formula sometimes does not open when clicking "Details" button to see complete one.
Alright let's keep "Assignment within IIF() function arguments.".