Evaluating Conditions

When Q++ evaluates a condition, the first thing it does is determine if you are comparing text or numbers. To do this, it looks at the result of the left-side token and the value of the RightSide, or the result of the token inside the RightSide. If both sides contain only digits from 0-9, then Q++ will compare numbers. Otherwise Q++ will compare the text values of each side.

If numbers are being compared, the operators have the expected meaning :

•= : represents equality; 5=5 or 12=12.

•~ : represents inequality; 5~3 or 12~11.

•< : represents less than; 2<5 or 11<12.

•> : represents greater than; 5>2 or 12>11.

If we are comparing text, the operators have the following meaning :

•= : represents equality; Olivier=Olivier or Pepper=Pepper.

•~ : represents inequality; Olivier~Paul or Pepper~PEPPER. Note that the comparison is case sensitive.

•< : represents is included; vier<Olivier or P<PEPPER.

•> : represents includes; Olivier>Oli or PEPPER>E.

Note that when testing that a string is empty (blank), you can either use nothing, or 0 on the right. So for example, [zFe=] and [zFe=0] will both be true if there are no e-holidays for the current DayValue.

You can force Q++ to compare numbers as text. To force textual comparison, place a blank space on the "open" end of the > or < operators. For example :

•[zd >3] will be true if the textual value of [d] contains the digit "3" (ie. for 3, 13, 23, 30, 31).

•[zd< 31] will be true if the textual value of [d] is contained in the string "31" (ie. for 1, 3, 31).

You do not need to force Q++ for equality and inequality, since regarless of whether we compare text or numbers, 5 always equals 5, and 12 will never equal 11.

See also : Using tokens on the RightSide.

Topic 142 updated on 04-Aug-17.

Topic URL: https://www.qppstudio.net/webhelp/index.html?evaluatingzapconditions.htm