Re: Need A Quick Fix

new topic     » goto parent     » topic index » view thread      » older message » newer message

Did you want to remove all games? There's no need for a loop!

Here's the docs:

deleteItem() also works with list view and tree view controls. position should be the item id returned when the item was created. To delete all items in a list view or tree view, position should be -1.

deleteItem(Game_List,-1) 

Did you intend to remove just one?

If so, note the docs - it does not expect the name of the item (e.g. "Ducktales"). You are passing a string, no surprise that it crashes.

It needs the item id of the selected item. Something like:

id = getIndex(Game_List) -- id of the selected item on the list 
if id > 0 then -- if no item is selected, this will be zero, so don't bother deleting 
  deleteItem(Game_List,id) 
end if 

Note: It has been 10 years since I did anything with Windows or Win32lib. Hope this is correct.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu