Or you could use a
while(PlusWnd.LstView_GetCount("ListView")) loop which would probably work as well. But I suppose Mattike's method is better
EDIT: Also your current method is looping 1 more time than is necessary as LstView_GetCount gives you the number of items in the listview, not the highest index - have you checked your Script Debugging Window?