本帖最后由 shaluoshuxia 于 2016-6-24 11:29 编辑
第一次发帖,格式有可能不对还请大神耐心看一下,谢谢。
代码结构如下:----GUICreate----
$hGui = ...
$Button = ...
;----GUICreate----
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
;msgbox(0,"",$BOMPath)
open()
For $i = 0 to UBound($infoarr,2)-1
local $strarray[] = [$infoarr[0][$i],$infoarr[1][$i],$infoarr[2][$i]]
;msgbox(0,"",UBound($infoarr,2))
;_ArrayDisplay($strarray,"")
$str = $strarray[1]
; $os = StringMid($strarray[0],4,1)
; $region = StringMid($str,7,1)
; $Gcode = $strarray[2]
MsgBox(0,"",$str)
Check()
;MsgBox(0,"","checked")
Next
EndSwitch
WEnd
Func open()
....
EndFunc
Func Check() ;MsgBox(0,"",UBound($arr,2))
Dim $result[UBound($arr,1)][UBound($arr,2)]
;_ArrayDisplay($result,"")
For $n=0 To UBound($arr,2)-1
For $l=0 To UBound($arr,1)-1
If $arr[$l][$n]<>"" Then
If StringReplace($arr[$l][$n]," ","") = $str Then
MsgBox(0,"",$n+1 & " " & $l+2)
执行程序段....
EndIf
EndIf
Next
Next
EndFunc
点击button后,程序运行,MsgBox(0,"",$str)循环显示,但是func check()不能执行, MsgBox(0,"",$n+1 & " " & $l+2)这段都没有输出。
我试过不加GUI直接给$str赋值数组,循环读取变量运行check(),这样是没问题的。
所以怀疑是GUI的机制问题造成的,还请大神不吝赐教。多谢! |