How is this compound ternary conditional expression interpreted and executed?
I would like to change this over to a nested if / else set of coding, which I think would be much easier to read and promote better understanding.
Many thanks, in advance.
x > nz(fit[1]) ? ((x - r) < nz(fit[1]) ? nz(fit[1]) : (x - r)) : ((x + r) > nz(fit[1]) ? nz(fit[1]) : (x + r))
Here is a version translated using if and else:
Note that the ternary expression you provided returns a value, and was most likely being used to make an assignment. So, I have added a variable
some_variable
which receives the value generated by the ternary expression.