Sign in to follow this  
Followers 0
Gif

listview item from an array

3 posts in this topic

as DaleHohm suggested i started a new topic, so my problem is just like the title says

i basically want the array to be displayed in listview items

$oTable1 = _IETableGetCollection($oIE, 3)
$aTableData1 = _IETableWriteToArray($oTable1)
Dim $ArrayStr = _ArrayToString($aTableData1 ,"|", 2);the problem
For $u = 0 To UBound($ArrayStr) - 1 
   GUICtrlCreateListViewItem($ArrayStr[$u], $ListView)
next

the problem is that _ArrayToString($aTableData1 ,"|", 2) does not works and nothing is returned.. so i guess something is wrong

thanks in advance

Share this post


Link to post
Share on other sites



Didn't know which thread to post this in, but i guess this will do. I prefer this method of dynamically creating parts of a listview. The big progress/sleep bit is just to let the user know the script is still running... :whistle:

#include <IE.au3>
#include <Array.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("AForm1", 825, 514, 193, 115)
$ListView1 = GUICtrlCreateListView("Name|Address|Game|Ver|Proto|Listed|Players|Last Seen ", 4, 8, 814, 494)
ProgressOn ("Loading Games", "Please wait while a list is generated")
$oIE = _IECreate ("http://stats.callofduty.com/index.php?search_name=all", 0, 0, 0, 0)
While Not _IELoadWait ($oIE) = 1 
    ProgressSet (10)
    Sleep(100)
    ProgressSet (20)
    Sleep(100)
    ProgressSet (30)
    Sleep(100)
    ProgressSet (40)
    Sleep(100)
    ProgressSet (50)
    Sleep(100)
    ProgressSet (60)
    Sleep(100)
    ProgressSet (70)
    Sleep(100)
    ProgressSet (80)
    Sleep(100)
    ProgressSet (90)
    Sleep(100)
    ProgressSet (100)
    Sleep(100)
    ProgressSet (90)
    Sleep(100)
    ProgressSet (80)
    Sleep(100)
    ProgressSet (70)
    Sleep(100)
    ProgressSet (60)
    Sleep(100)
    ProgressSet (50)
    Sleep(100)
    ProgressSet (40)
    Sleep(100)
    ProgressSet (30)
    Sleep(100)
    ProgressSet (20)
    Sleep(100)
    ProgressSet (10)
    Sleep(100)
    ProgressSet (00)
    Sleep(100)
Wend 
ProgressOff ()
$oTable1 = _IETableGetCollection($oIE, 3)
$aTableData1 = _IETableWriteToArray($oTable1)
For $i = 1 to Ubound ($aTableData1, 2) -1
    $row = ""
    For $x = 0 to Ubound ($aTableData1, 1) -1
        $row &= $aTableData1[$x][$i] & "|"
    Next
_GUICtrlListViewInsertItem ($ListView1, -1, $row)
Next

GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Didn't know which thread to post this in, but i guess this will do. I prefer this method of dynamically creating parts of a listview. The big progress/sleep bit is just to let the user know the script is still running... :whistle:

#include <IE.au3>
#include <Array.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("AForm1", 825, 514, 193, 115)
$ListView1 = GUICtrlCreateListView("Name|Address|Game|Ver|Proto|Listed|Players|Last Seen ", 4, 8, 814, 494)
ProgressOn ("Loading Games", "Please wait while a list is generated")
$oIE = _IECreate ("http://stats.callofduty.com/index.php?search_name=all", 0, 0, 0, 0)
While Not _IELoadWait ($oIE) = 1 
    ProgressSet (10)
    Sleep(100)
    ProgressSet (20)
    Sleep(100)
    ProgressSet (30)
    Sleep(100)
    ProgressSet (40)
    Sleep(100)
    ProgressSet (50)
    Sleep(100)
    ProgressSet (60)
    Sleep(100)
    ProgressSet (70)
    Sleep(100)
    ProgressSet (80)
    Sleep(100)
    ProgressSet (90)
    Sleep(100)
    ProgressSet (100)
    Sleep(100)
    ProgressSet (90)
    Sleep(100)
    ProgressSet (80)
    Sleep(100)
    ProgressSet (70)
    Sleep(100)
    ProgressSet (60)
    Sleep(100)
    ProgressSet (50)
    Sleep(100)
    ProgressSet (40)
    Sleep(100)
    ProgressSet (30)
    Sleep(100)
    ProgressSet (20)
    Sleep(100)
    ProgressSet (10)
    Sleep(100)
    ProgressSet (00)
    Sleep(100)
Wend 
ProgressOff ()
$oTable1 = _IETableGetCollection($oIE, 3)
$aTableData1 = _IETableWriteToArray($oTable1)
For $i = 1 to Ubound ($aTableData1, 2) -1
    $row = ""
    For $x = 0 to Ubound ($aTableData1, 1) -1
        $row &= $aTableData1[$x][$i] & "|"
    Next
_GUICtrlListViewInsertItem ($ListView1, -1, $row)
Next

GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd
thanks i changed 2-3 things and now it works perfect

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0