本帖最后由 cynthia59 于 2013-5-24 13:24 编辑
读取数组里的值,运行前不提示错误,能弹出框,但运行结束会提示有错误。
当RunPressed中有多个条件语句时只能运行第一个,不知是否与这个错误提示有关系?
请高手帮忙看一下?#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <Constants.au3>
#include <EditConstants.au3>
Opt ('GUIOnEventMode',1)
; GUI
$parent = GuiCreate('1', 400, 420)
GUISetOnEvent($GUI_EVENT_CLOSE, 'SpecialEvents')
GUISetOnEvent($GUI_EVENT_MINIMIZE, 'SpecialEvents')
GUISetOnEvent($GUI_EVENT_RESTORE, 'SpecialEvents')
$Edit_1 = GuiCtrlCreateEdit('1'& @CRLF & '2' & @CRLF &'3' & @CRLF, 10, 93, 380, 150 )
$Button_8 = GuiCtrlCreateButton('运行脚本', 250, 383 , 143 , 30)
GUICtrlSetOnEvent(-1, 'RunPressed')
Func RunPressed()
$str = GUICtrlRead($Edit_1) ;获取工程列表
If StringRight($Str, 1) = @LF Then $Str = StringTrimRight($Str, 1) ;去掉最后一个空行
$ProjName = StringSplit ( $str, @LF , 1 ) ;读取工程列表,拆分成数组返回
For $i=1 to UBound($ProjName)
If Not @Error Then _Cal($ProjName[$i]) ;这句提示错误!!!!!!!!!
Next
EndFunc
Func _Cal($ProjName)
MsgBox(0,'',$ProjName)
EndFunc
Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
Exit
Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
Case @GUI_CtrlId = $GUI_EVENT_RESTORE
EndSelect
EndFunc ;==>SpecialEvents
; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
|