Iif compile-time return value

Forum for discussion about the documentation project.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Iif compile-time return value

Post by fxm »

Yes, it was that I wrote before my last documentation update (suppressing all details related to the case of a constant as condition):
When IIf treats expressions of mixed numeric types:
  • - if the condition is resolved at compile-time:
    • - the result type is that of the expression satisfying the condition,
    - if the condition can only be solved at run-time:
    • - if at least one expression is of floating-point type, the result type is the floating-point type (the bigger in case of two floating-point types),
      - if the two expressions are of integer types, the result type is the bigger type of both (see Coercion and Conversion for the precise ranking of integer types).
Post Reply