1. Michael Kramer
  2. PowerBuilder
  3. Wednesday, 9 September 2020 19:18 PM UTC

Hi All,
Boolean operators AND, OR, and NOT have different precedence in DataWindow expressions than in PowerScript.
Also, DataWindow expressions have SQL like operators that don't exist in PowerScript.

I advise you always use parenthesis to avoid undesired surprises. Even when you think expression is simple, you may get fooled! Earlier today I fooled myself once more - because I skipped parenthesis.

 

Environment PowerScript DataWindow Expressions
Boolean and
relational
operator
precedence
  1. ( )
  2. =, >, <, <=, >=, <>
  3. NOT
  4. AND
  5. OR
  1. ( )
  2. IN, LIKE, BETWEEN
  3. =, >, <, <=, >=, <>
  4. AND, OR
  5. NOT
Example NOT false OR true NOT false OR true
Evaluates as (NOT false) OR true NOT(false OR true)
Result true false

 

Watch out for operator precedence while you create DataWindow expressions.
HTH /Michael

Daniel Vivier Accepted Answer Pending Moderation
  1. Monday, 28 September 2020 18:26 PM UTC
  2. PowerBuilder
  3. # 1

Yeah I've been bitten by that one more than once. 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.