Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Comparing hierarchies

Comparing hierarchies

You can use the equal to (=) and not equal to (!=) operators to compare two arrays or two structs.

Comparing arrays

Two arrays are equivalent if the following conditions are true:
  • The array elements are the same data type.
  • The arrays are the same size.
  • The element at each index is the same.
For example, you have the following arrays:
A = [1, 2, 3] B = [1, 2, 3]
You can make the following comparison:
A = B
Both arrays contain integers, the arrays are the same size, and the element at each index is the same such that
A[0]=B[0], A[1]=B[1], and A[2]=B[2]
. The return value is TRUE (1).

Comparing structs

Two structs are equivalent if the following conditions are true for the corresponding struct elements:
  • The elements are the same data type.
  • The elements hold the same data.
Two structs are equivalent even if the elements have different names.
For example, you have the following structs:
struct1 { name:'Paul' zip:10004 } struct2 { firstname:'Paul' zip1:10004 }
You can make the following comparison:
struct1 = struct2
The corresponding elements are the same data type and hold the same data, so the return value is TRUE (1).

0 COMMENTS

We’d like to hear from you!