Please enable JavaScript to view this site.

 

Navigation: Tokens > Conditional Tokens

Evaluating Conditions

Scroll Prev Up Next More

When the condition of a conditional token or a zap token is evaluated, the first step is to determine if we 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++Studio will compare numbers. Otherwise Q++Studio will compare the text values of each side.

 

Comparing numbers or dates

 

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.

 

Comparing text

 

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. (the comparison is case sensitive).

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

> represents includes/contains; 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.

 

Forcing text comparison

 

You can force textual comparison, even if both sides are numbers.

 

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 textual comparison equality and inequality, since, regardless of whether we compare text or numbers, 5 always equals 5, and 12 will never equal 11.

 

See also: DayValues inside the conditions of zap or conditional tokens and using tokens on the right side of conditions.

 


Topic 000142, last updated on 17-Apr-2020