0

Why I am getting false if both the lists are the same? Check the code below

♥list1⟦⟧=a❚b❚c❚d
♥list2⟦⟧=a❚b❚c❚d
dialog ♥list1==♥list2
aminography
  • 21,986
  • 13
  • 70
  • 74
Thomas
  • 81
  • 4
  • 1
    g1ant seems to be developed in top of C# and with C# you cannot compare array like that. I believe you need a custom method unless g1ant have a build in method for that. – Clément Baconnier Nov 06 '19 at 07:44

1 Answers1

2

The lists are not the same, they just contain the same elements. To check that, you need to compare each list elements to each other for example as below.

♥list1 = a❚b❚c❚d
♥list2 = a❚b❚c❚d

♥areListsTheSame = true

if ⊂♥list1.Count == ♥list2.Count⊃
    ♥i = 1
    while ⊂♥areListsTheSame && ♥i <= ♥list1.Count⊃
        if ⊂♥list1⟦♥i⟧ != ♥list2⟦♥i⟧⊃
            ♥areListsTheSame = false
        end if
        ♥i = ♥i + 1
    end while
else
    ♥areListsTheSame = false
end if

if ⊂♥areListsTheSame⊃
    dialog ‴The lists are the same‴
else
    dialog ‴The lists are not the same‴
end if
Wiktoria Prusik
  • 840
  • 4
  • 15