Wrong true value of reference variable Topic is solved

Report problems with documented functionality
Posts: 7057
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Wrong true value of reference variable  Topic is solved

12 Apr 2019, 22:18

"The rules of the distinction" is all-inclusive - there are no other rules, and no room for interpretation about this "fact". The original wording does not have this meaning.

The documentation literally says x, and you literally say y. Your inference that "y can't be false because x is true" is based on the unspoken false assumption that x == y. My point was that x != y.

Also, I updated the documentation prior to your reply, but you may have to force refresh.
An if-statement that contains an expression is usually differentiated from a traditional-if such as If FoundColor <> Blue by enclosing the expression in parentheses. However, this is not strictly required, as any if-statement which does not match any of the legacy if patterns is assumed to contain an expression. In particular, the following are also common ways of writing an if (expression):
  • Starting with an open parenthesis but not fully enclosing the expression: if (x > 0) and (y > 0)
  • Starting with a function call: if InStr(a, b)
  • Starting with an operator such as not or !: if !MyVar
Known limitation: For historical reasons, if (expression) actually accepts a Numeric Parameter rather than a pure expression. For example, if %MyVar% is equivalent to if MyVar. This can be avoided by always enclosing the expression in parentheses.
Last edited by lexikos on 07 May 2019, 03:29, edited 1 time in total.
Reason: add quote

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests