FEATURE RICH
RAPID APPLICATION DEVELOPMENT
HELPING YOU OR YOUR CUSTOMERS
MANAGE THEIR BUSINESS

<-- Back to Commands (Math & Logic)

{COMPARE(value1, method, value2)}

You can use this command to compare two values and return TRUE or FALSE.
You can also use it as an inline if statement instead of the {IIF()} command.

Using this command will usually speed up execution time as the system doesn't need to process the expression.

While you can often simply use something like {V_X} != {V_Y} in an IF statement, it is sometimes better to use {COMPARE({V_X}, != , {V_Y})}.
If the variable V_X was empty and the variable V_Y contained the value "10" then the expression {V_X} != {V_Y} would end up as " != 10" and could yield unpredictable results.

Using the COMPARE command, and for the same reason, the {EMPTY()} command, produces a predictable result.

Parameters
Number Name Default Type Description
1 value1 String The first value
2 method = String The comparison method to use: =, ==, !=, <>, <=, >=
3 value2 String The second value
4 true TRUE String The value to return if the comparison is true.
5 false FALSE String The value to return if the comparison is false
Log in to add a Comment.