未考虑数组中有重复数据的情况。慎用
Local $A[4] = ["a", "b", "c", "d"]
Local $B[5] = ["a", "b", "e", "c", "d"]
Local $time=TimerInit()
MsgBox(0,TimerDiff($time),_arraycomp($A,$B))
Func _arraycomp($Array1,$Array2)
Local $temp,$result
If UBound($Array1)=UBound($Array2) Then
Return 1
ElseIf UBound($Array1)>UBound($Array2) Then
$temp=$Array1
$array1=$Array2
$array2=$temp
EndIf
For $i=0 To UBound($array1)-1
If Not IsDeclared($array1[$i]) Then Assign($array1[$i],$i)
Next
For $i=0 To UBound($array2)-1
If Not IsDeclared($array2[$i]) Then
$result&=$array2[$i]&"|"&$i&@CRLF
EndIf
Next
Return $result
EndFunc
|