The problem lies elsewhere.
startBlue
`Reconstruct variables
type field
deleteButton as integer
listbox as integer
endtype
type genfield
maxEvents as integer
endtype
tab1 as field
general as genfield
general.maxEvents = 10
`Create simple UI
tab1.deleteButton = createButton(5, 5, 100, 20, "DeleteButton", 0, 0)
tab1.listbox = createListBox(5, 30, 200, 500, 0)
for i = 0 to 5
addItem tab1.listbox, "Item" + str$(i)
next i
do
`Get events
getEvent
`*****************************************
selItem = selectedItem(tab1.listBox)
if eventSource()=tab1.deleteButton
if eventType()=0x202
setGadgetText tab1.deleteButton , str$(selItem)
if selItem =>0 and selItem =< general.maxEvents
removeItem tab1.listbox,selItem
deleteEvent(selItem)
endif
endif
endif
`*****************************************************
loop
function deleteEvent(item)
endfunction
It does exactly what it's supposed to do.
Sorry, we can't help you...
It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.