Compare operations
Pulsar supports compare operations such as <
,>
,==
and others but the syntax is a bit different than in other languages. Instead of operators, you use functions:
The following compare functions are available:
is.gt
is.gt
results to true when argument 1 is greater than argument 2.
is.lt
is.gt
results to true when argument 1 is less than argument 2.
is.nil
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
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
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
).
iif
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
.
Last updated
Was this helpful?