谢谢指明数组问题,这样修改 测试用例可以正常运行了。接着折腾下一步了。
#include <Excel_new.au3>
#include <Array.au3>
#include <File.au3>
Local $oData1 = '姓名'
Local $oData2 = '身份证'
Local $oData3 = '诈骗'
Local $FileName = FileOpenDialog("浏览EXCEL格式", "", "EXCEL2010格式(*.xlsx)|EXCEL2007以下格式(*.xls)", 1)
Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, $FileName) ;打開EXCEL表
With $oWorkbook.ActiveSheet ;worksheets("")
$ProdArray = .range("a1").currentregion.value
For $n = 0 To UBound($ProdArray) - 1
For $i = 0 To UBound($ProdArray, 2) - 1
$ProdArray[$n][$i] = StringReplace($ProdArray[$n][$i], "'", "")
Next
Next
EndWith
_ArrayDisplay($ProdArray)
MsgBox(0, '', $ProdArray[3][0])
For $Row = 0 To UBound($ProdArray, 2) - 1
Local $aArray1 = StringRegExp($ProdArray[3][$Row], $oData1, 3)
Local $aArray2 = StringRegExp($ProdArray[3][$Row], $oData2, 3)
Local $aArray3 = StringRegExp($ProdArray[3][$Row], $oData3, 3)
Local $a = UBound($aArray1)
Local $b = UBound($aArray2)
Local $c = UBound($aArray3)
Select
Case $a >= 0 and $b >= 0 and $c > 0
MsgBox(0, '', $ProdArray[3][$Row] & ' ' & '结果是: 符合', 1)
EndSelect
Next
MsgBox(0, '', 'Over')
|