本帖最后由 cutyourchicken 于 2011-2-16 03:33 编辑
3个for循环嵌套,会大量占用CPU,有什么办法解决吗?Func UpdateDat()
$Mlistcount=_GUICtrlListView_GetItemCount(GUICtrlGetHandle($listview1))
Dim $array[$count][$sub]
For $i = 0 To $count - 1
For $x = 0 To $sub - 1
$array[$i][$x] = ControlListView($handle, '', $ctrl, 'GetText', $i, $x)
If $array[$i][8]<> "" Then
$Info= "X..." Else
If $array[$i][0] == "" Then
$Info= "Y..."
Else
$Info= "Z..."
EndIf
EndIf
For $bi = 0 To $Mlistcount-1
If _GUICtrlListView_GetItemText(GUICtrlGetHandle($listview1),$bi,0)==StringTrimLeft($array[$i][1],1) Then
_GUICtrlListView_SetItemText($listview1,$bi,$array[$i][9],1)
_GUICtrlListView_SetItemText($listview1,$bi,$array[$i][5],2)
_GUICtrlListView_SetItemText($listview1,$bi,$array[$i][8],3)
_GUICtrlListView_SetItemText($listview1,$bi,$Info,4)
ExitLoop
EndIf
Next
Next
Next
EndFunc
不好意思,代码排得比较乱,改了一下了 |