The row
and columns of a listview are base-0.
This means that the first row is row 0 (not row 1) and the first column is column 0 (not column 1).
code:
for(i = 1; i <= LastNotif; i++) {
D = XmlParser.selectSingleNode("//Notification" + i);
NotificationNames[i] = D.getAttribute("Value");
// Adds a new item in the first column (column index 0) and on the next row (which is row with index 0 in the first iteration of the loop, not index 1)
WndNotifs.LstView_AddItem("LstVNotifs",NotificationNames[i]);
NotificationPages[i] = Script.MainUrl + D.getAttribute("Page");
// Yet here you tell Plus! to add data in the third column (index 2) on the second row (index "i"), which doesn't exist yet
WndNotifs.LstView_SetItemText("LstVNotifs",i,2,NotificationPages[i]);
}
If you want to keep the i variable starting at 1 you must substract 1 from the index for the row and column you whish to set...
Same for GetItemText.
To make it very clear: If you want this kind of list:
Name Age
----------------------
Jana 25
Chris 19
Kurt 31
You would do:
LstView_AddItem("mylist", "Jana")
LstView_SetItemText("mylist",
0,
1, "25")
LstView_AddItem("mylist", "Chris")
LstView_SetItemText("mylist",
1,
1, "19")
LstView_AddItem("mylist", "Kurt")
LstView_SetItemText("mylist",
2,
1, "31")
and:
LstView_GetItemText("mylist",
0,
0) will return "
Jana"
LstView_GetItemText("mylist",
1,
1) will return "
19"