Re: Need A Quick Fix

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

Hey Guys,

Every time I try to remove a selected item from a listbox, my program crashes.

sequence nesgames = {"Contra","Ducktales","Super Mario Bros.","Super Mario Bros. 2","Super Mario Bros. 3", 
"Zelda 2: Link's Adventure"} 
procedure Add_Game(integer self,integer event, sequence parm) 
end procedure 
procedure Remove_Game(integer self, integer event, sequence parm) 
	for i = 0 to length(nesgames) do 
		if i >= 0 then 
			deleteItem(Game_List,nesgames[i]) --somewhere here causes it to crash 
		end if 
	end for 
end procedure 

I'll take a stab at this:

If i = 0 then there is no element in the sequence nesgames to delete from Game_List.

If your click/selection routine returns a value based on the first item in the selection list having an index value 0f 0, then you will need to add 1 to that value to reference the index the item in the nesgames sequence you want to delete. Not sure why you would need a loop or a special DeleteItem routine to do that though, it seems Game_List = remove_item(Game_List,nesgames[i+ClickValue]) should suffice.

I probably shouldn't have tried to offer a solution, since I do not know how the Windows GUI works.

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


Quick Links

User menu

Not signed in.

Misc Menu