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
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
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