Compare operations
Last updated
Was this helpful?
Last updated
Was this helpful?
Pulsar supports compare operations such as <
,>
,==
and others but the syntax is a bit different than in other languages. Instead of operators, you use :
The following compare functions are available:
is.gt
results to true when argument 1 is greater than argument 2.
is.gt
results to true when argument 1 is less than argument 2.
is.nil
results to true when argument 1 is nil. Note that value ofnil
is not the same as not defined
! For example, retrieving detail about a specific screen that didn't exist produces nil, however not defining the variable is completely different
is.defined
results to true when argument 1 is undefined. Undefined variables were never defined in the current context (or in global context). Note that defined variables which are nil
will result in false
.
is.equals
results to true when both arguments are equal. Note that this means they have the same value (but don't necessarily have to have the same data type, such as Double
and Integer
defined number 1
).
Ternary function iif
can be used to evaluate a boolean statement and then use one of two declared results:
In the example above, the statement (@is.equals(textVariable, "Test")
) is evaluated. When true
, myVariable
is defined as 1
, while when resulting to false
, myVariable
is defined as 2
.