Tinderbox v9 Icon

between(valueNum, minNum, maxNum)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Query Boolean  [other Query Boolean operators]

 Baseline

 As at baseline


between(valueNum, minNum, maxNum)

Returns Boolean true if the valueNum is greater or equal to minNum and less than maxNum. The comparison method is based on the type of valueNum; numerical, lexical, string and set comparisons are chosen as needed.

The logic is:

((valueNum >= minNum) & (valueNum < maxNum))

Thus between() is true if valueNum==minNum but false if valueNum==maxNum.

If $MyNumber is 7, then:

$MyBoolean = between($MyNumber, 1, 5); is false 

$MyBoolean = between($MyNumber, 1, 9); is true 

More realistically the operator would be used in a query or a conditional expression:

if(between($MyNumber, 1, 5)){…}else{…}; would test as true and execute the code in the first conditional branch.

Do not use this operator for testing Date-type attributes directly. Either use days() instead or use between() with format() or Date.format() to create a suitable string values for testing.

In the query creation pop-ups of agent and Find dialogs this function is listed as "is between".

Legacy issues

This operator replaces the legacy #between query operator.