Function to Test If Two Lists/Arrays are Same

Mindwatering Incorporated

Author: Tripp W Black

Created: 06/05/2009 at 05:00 PM

 

Category:
Notes Developer Tips
LotusScript

Function CompareLists(oldVals As Variant, newVals As Variant) As Boolean
Dim removedVals As Variant
Dim addedVas as Variant
removedVals = Fulltrim(Arrayreplace(oldVals, newVals, ""))
addedVals = Fulltrim(Arrayreplace(newVals, oldVals, ""))
If (removedVals(0) = "") And (addedVals(0) = "") Then
CompareLists= False
Else
CompareLists= True
End If
End Function

Note:
Assumes lists have each element only once.
Code is based on Stan Roger's code he posted some time back on Notes.net.

previous page