Hi,
now, i had some time to think it over(the last evening).
For the comparison, you have to touch each value in each array at least once. Even doing a Split(Array) will touch each value internally once and so concatentating the Values to one string will be nearly same time as running through the indices.
Getting a Value in an Array by index is as fast as getting an Value by key in a list, so we dont need the list in my first posting to do the comparison. And both Values/Arrays are allready in Memory. So the most consuming time will be the comparison of the two values and this will be the bottleneck. Creating a password-Hash for the concatenated values and compare them will then be in most cases more time consuming than comparing them directly (it depends on the complexity of the values, shure)
so if the equality is a:b:c is eqal to a:b:c and not equal to a:c:b, the easiest will be :
checkEquality = true
for i = 0 to ubound(firstArray)
if not isequal(firstArray, secondArray, i) then
checkEquality = false
exit forall
end if
end forall
function isEqual(fArr as Variant, sArr as Variant, indx as integer) as integer
isEqual = false
fVal = fArr(i)
sVal = sArr(i)
if not datatype(fVal) = datatype(fVal) then exit function
select case datatype(fVal)
case "String" : Comparison for String-Values
case "integer" : Comparison for Integer-Values
….
One has to do the main checks (number of Elements are equal, both are Arrays) before doing the
comparison-Function, but with such a function one will be able to change the comparison-functionality
withot changing the rest of the code, even odd comparisons (eg, integer 1 will be eqal to string "A" are then possible by doing some exeptions in the equality-Function
And you can tune the performance for the comparison according to the needs, for example you wont have to convert all values to string, hence they are allready all in integer.
Hope , my thougts are not to crude
with kind regards,
Holger