[已解决]要抓Listview裡面Status列裡面有幾個Noupdate
本帖最后由 ipmitool 于 2016-10-11 16:47 编辑請問一下我寫了一段程式要抓Status有幾個Noupdate
可是怎麼抓到的數量是Noupdate+Ongoing的數量?
是不是我的正則邏輯有問題...
$noupdate_going = _GUICtrlListView_GetItemText($hListView,$j+1,7) ---> 去抓我現在Noupdate的字串是有抓到的
可是下面這三行好像除了抓noupdate, 連不是noupdate都+1了...這要怎麼處理? 我只要Noupdate的數量...
For $countNoupdate = 0 To UBound($aNewList)-1 STEP 1
if $noupdate_going="Noupdate" Then
$countNoupdate=$countNoupdate+1
If IsArray($OldList) Then
ReDim $aNewList0
For $j=0 TO UBound($OldList)-1 STEP 1
IF $aNewList0[$j] < $systemtime THEN
_GUICtrlListView_SetItemText($hListView, $j+1,"Noupdate",7)
Else
_GUICtrlListView_SetItemText($hListView, $j+1,"Ongoing",7)
EndIf
$noupdate_going=_GUICtrlListView_GetItemText($hListView,$j+1,7)
For $countNoupdate = 0 To UBound($aNewList)-1 STEP 1
if $noupdate_going="Noupdate" Then
$countNoupdate=$countNoupdate+1
Else
EndIf
Next
GUICtrlCreateLabel('Noupdate: '&$countNoupdate, 800, 560, 100, 20)
$countOngoing=UBound($aNewList)-$countNoupdate
GUICtrlCreateLabel('Ongoing: '&$countOngoing, 800, 580, 100, 20)
Next
$OldList=$aNewList0
Else
$OldList=$aNewList0
EndIf 不曉得有人可以幫忙嗎...謝謝喔... 解決嘍~謝謝大家 If IsArray($OldList) Then
ReDim $aNewList0
For $j=0 TO UBound($OldList)-1 STEP 1
IF $aNewList0[$j] < $systemtime THEN
_GUICtrlListView_SetItemText($hListView, $j+1,"Noupdate",7)
Else
_GUICtrlListView_SetItemText($hListView, $j+1,"Ongoing",7)
EndIf
$noupdate_going=_GUICtrlListView_GetItemText($hListView,$j+1,7)
if $noupdate_going="Noupdate" Then
$iii=$iii+1
Else
EndIf
if $noupdate_going="Ongoing" Then
$ooo=$ooo+1
Else
EndIf
Next
GUICtrlCreateLabel('Noupdate: '&$iii, 800, 560, 100, 20)
GUICtrlCreateLabel('Ongoing: '&$ooo, 800, 580, 100, 20)
页:
[1]