Jump to content

Recommended Posts

Posted

because you aren't changing where it is setting.

I just realized the problem is because I set the index to 0!!! I'm so stupid! :)

$dateitems = _GUICtrlListViewSetItemText($nListview, 0, 2, $date_); Sets the date from the INI file
While Alive() {
	 DrinkWine();
}
AutoIt Programmer
Posted

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>

Global $readsection

$hGui = GuiCReate("Test", 300, 200)

$hListView = _GUICtrlListView_Create($hGui, "Items|SubItems", 10, 10, 280, 180, -1, $WS_EX_CLIENTEDGE)

$readsection = IniReadSection("C:\buddies.ini", "OnlineBuddies")
If IsArray($readsection) Then
    For $i = 1 To $readsection[0][0]
        $item = StringRegExp($readsection[$i][1], "~?(\d{1,}-\d{1,}-\d{1,})", 1)
        _GUICtrlListView_AddItem($hListView, $item[0])
    Next
EndIf

GUISetState()

Do
Until GUIGetMsg() = -3

I just realized the problem is because I set the index to 0!!! I'm so stupid! :)

$dateitems = _GUICtrlListViewSetItemText($nListview, 0, 2, $date_); Sets the date from the INI file

To avoid confusing FireLord any more I do not believe stringreg would be the best idea. But I already suggested not using setItemText and use guictrlcreatelistviewItem

Posted

The problem I had before was it was setting the date in the first item, and I figured out it was because I had the index set to 0 on the _GUICtrlListViewSetItemText() line. Now I have it to $z and it is only setting it to the second item. What's the problem? :)

$readsection = IniReadSection("C:\buddies.ini", "OnlineBuddies")
    If IsArray($readsection) Then
        For $z = 1 To $readsection[0][0]
            MsgBox(0, "", 'Key: ' & $readsection[$z][0] & @CRLF & 'Value: ' & $readsection[$z][1])
            $var0 = StringSplit($readsection[$z][1], "~")
            $var1 = StringSplit($readsection[$z][1], ";")
            $date_ = StringTrimLeft($var1[UBound($var1)-1], 1)
            $dateitems = _GUICtrlListViewSetItemText($nListview, $z, 2, $date_); Sets the date from the INI file
        Next
    EndIf
While Alive() {
	 DrinkWine();
}
AutoIt Programmer
Posted

Have you even looked at _GUICtrlListView_SetItemText in the help file?

Yes, is there some point your trying to make?? :)

While Alive() {
	 DrinkWine();
}
AutoIt Programmer
Posted (edited)

Look at the help file... Look at how the parameters are... look at yours....

Mine are fine?

:)

Edit: Don't forget that I have an older version so they probably changed the format...

My version:

_GUICtrlListViewSetItemText ( $h_listview, $i_index, $i_subitem, $s_text )

Edited by FireLordZi
While Alive() {
	 DrinkWine();
}
AutoIt Programmer

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
×
×
  • Create New...