#include <array.au3>
Dim $avArray[5] = [1, 2, 3, 4, 5], $anArray[5] = ["A", "B", "C", "D", "E"]
Compare($avArray, $anArray)
Func Compare($arr1, $arr2)
If IsArray($avArray) And IsArray($anArray) Then
$arr1 = $avArray
$arr2 = $anArray
If UBound($avArray, 0) == UBound($avArray, 0) Then
$num = UBound($avArray, 0)
If UBound($arr1) == UBound($arr2) Then
$comp = StringCompare(_ArrayToString($arr1, ""), _ArrayToString($arr2, ""), 1)
If $comp = 0 Then
MsgBox(0, 0, "两数组相等")
Else
MsgBox(0, 0, "不相等")
EndIf
Else
MsgBox(64, "", "数组数量不同,比较无意义")
EndIf
Else
MsgBox(64, "", "数组维度不同,比较无意义")
EndIf
Else
MsgBox(64, "wring", "不是数组")
EndIf
EndFunc ;==>Compare
|