回复 18# ipmitool
是
Eval('g_hTimer' & $j) =TimerInit()
这样,的确不行啊,
给你一个建议,Timer1~4只保留一个Timer1,稍微修改一下,
Func Timer1()
_TicksToTime(Int(TimerDiff($g_hTimer1)), $g_iHour1, $g_iMins1, $g_iSecs1)
Local $sTime1 = $g_sTime1 ; save current time to be able to test and avoid flicker..
$g_sTime1 = StringFormat("%02i:%02i:%02i", $g_iHour1, $g_iMins1, $g_iSecs1)
If $sTime1 <> $g_sTime1 Then _GUICtrlListView_SetItemText($hListView,0, $g_sTime1, 3)
EndFunc ;==>Timer1
然后buttone1就不再注册Timer1的时间了,而是把他放在_add_report_items111()里AdlibUnRegister('Timer1')
$g_hTimer1 = TimerInit()
AdlibUnRegister('Timer1')
这样每次重新读取TXT的数据,计时器就会刷新了
AdlibUnRegister('Timer1')
$g_hTimer1 = TimerInit()
;Local $aNewList = _txttolistview()
$j = UBound($aNewList) - 1
If $aNewList[$j][2] = 'done' Then
MsgBox(0, "", "全部是done了,可以注销了")
AdlibUnRegister('_add_report_items111')
AdlibUnRegister('Timer1')
EndIf
$aNewList[0][2] = 'done' ;先設第一個為Done
For $j = 1 To UBound($aNewList) - 1
If $aNewList[$j][2] = "done" Then
_GUICtrlListView_SetItemText($hListView, $j, "完成", 3)
EndIf
If $aNewList[$j][2] = "Preparing" Then
AdlibRegister('Timer1')
ExitLoop
EndIf
If $aNewList[$j][2] = "---" And $aNewList[$j - 1][2] = "done" Then
;~ MsgBox(0, "", "程序准备完成,可以运行" & $aNewList[$j][1], 1)
Run("_" & $aNewList[$j][1] & ".exe")
ExitLoop
EndIf
Next
|