ListIsEqual Function

Action

Checks if two lists have the same elements, the same type, and the same length.

Include file

List.bdh

Syntax

ListIsEqual(
   in leftList: list,
   in rightList: list): boolean;
Parameter Description
leftList List of number, boolean, float or string.
rightList List of number, boolean, float or string.

Return value

  • true if successful
  • false otherwise

Example

transaction TAListIsEqual
var
  lstNumber: list of number init 1, 2, 3;
  lstNumber2: list of number init 1, 2, 3;
  retVal1: boolean;
begin
  retVal1 := ListIsEqual(lstNumber, lstNumber2);
  writeLn("the lists are equal: " + string(retVal1));
  ListAdd(lstNumber, 4);
  retVal1 := ListIsEqual(lstNumber, lstNumber2);
  writeLn("the lists are equal: " + string(retVal1));
end TAListIsEqual;

Output

the lists are equal: TRUE
the lists are equal: FALSE