Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Listview

$
0
0
Hello,

I'm using autoit for one week now. I'm new to programming, but i really enjoy playing around with it.
Now, i'm trying to make a script that creates a listview from the data in a text file. The data in the listview should correspond to the data in the textfile, so if it gets updated, the listview should update aswell.
When i run the script my listview items are properly created, but whenever i update the textfile, my array is getting updated, but my listview aint removing the old lines.
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView)) returns True
_GUICtrlListView_GetItemCount($hListView) returns 0
But in fact nothing gets removed from my listview, and all the old items are displayed.

Bug or just me being stupid? (Probably the last one :) )
What am i doing wrong? Any other approaches to this?

[ autoit ]         
While 1 $lines = _FileCountLines("\\Sharepc\Share\data.txt") If $lines <> $nrrows Then $csv = FileRead("\\Sharepc\Share\data.txt") $csv = StringStripWS($csv, 7) $rows = StringSplit($csv, @CRLF, 2) $nrrows = UBound($rows) Dim $entries[$nrrows + 1][5] For $i = 0 to $nrrows - 1 $temp = StringSplit($rows[$i], ";", 2) For $j = 0 to UBound($temp) - 1 $entries[$i][$j] = $temp[$j] Next Next ReDim $entries[$nrrows][4] _ArrayDisplay($entries) $deleteall = _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView)) ConsoleWrite($deleteall & @CRLF) $itemcount = _GUICtrlListView_GetItemCount($hListView) ConsoleWrite($itemcount & @CRLF) _GUICtrlListView_AddArray($hListView, $entries) EndIf WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>