Comparing variables of the same imported type
In any conditional expression (for example, in the Condition field
of a conditional action) in which you are comparing two variables
of the same imported type, you should implement a comparison method
(such as equals()) in the underlying class rather than
using the variables themselves. For example,
$htUserData.equals($htPortData$)$
If
instead, you compare the variables themselves (for example $htUserData$
== $htPortData$), then:
- The macro runtime, for each variable, calls the toString() method of the underlying Java class and gets a string result
- The macro runtime compares the two string results and gets a boolean result.
- The macro runtime sets the result of the condition to the boolean result obtained in step 2.