#include <array.au3>
$txt="苹果|1|2|"&@CRLF _
&"西瓜|1|3|"&@CRLF _
&"香蕉|2|4|"
;====将字符串定义成多维数组====
Local $arr_master=StringSplit($txt,@CRLF,2+1)
If @error Then Exit
Local $cols=StringSplit(StringTrimRight($arr_master[0],1),"|",2)
$cols=UBound($cols)
Local $array[UBound($arr_master)][$cols]
for $i=0 to UBound($arr_master)-1
$temp=StringSplit(StringTrimRight($arr_master[$i],1),"|",2)
for $n=0 to UBound($temp)-1
$array[$i][$n]=$temp[$n]
Next
Next
_ArrayDisplay($array)
;====定义数组结束====
;====判断====
for $i=0 to UBound($array)-2
;for $n=0 to UBound($array,2)-1
if $array[$i][1]=$array[$i+1][1] then
msgbox(0x40000,"",$array[$i][1]&" = " & $array[$i+1][1])
Else
msgbox(0x40000,"",$array[$i][1]&ChrW(8800) & $array[$i+1][1])
EndIf
;Next
Next
|