[thelist] RE: Comparing Arrays in ASP
Peter Brunone (EasyListBox.com)
peter at easylistbox.com
Thu Aug 26 16:17:42 CDT 2004
If UBound(Array_A) <> UBound(Array_B) Then
' Arrays are different
Else
' Do the loop you have below
End If
In VBScript, Array is classified as a function rather than an object, so there are some limitations.
Cheers,
Peter
Original Message:
>From: Rob Smith <rob.smith at THERMON.com>
>I think the long way around this is to apply the tracheotomy axiom:
>
>If Array_A.count < Array_B.count then
> arrays are different
>else if Array_A.count > Array_B.count then
> arrays are different
>else // arrays are same length, campare each element...
> for x = 0 to Array_A.count
> if not Array_A(x) = Array_B(x) then
> arrays are different
> x = Array_A.count
> end if
> next
>end if
>
>Is there a shorter way?
>
>Rob
More information about the thelist
mailing list