Problem with Scrolling List Field

David Burgun dburgun at dsl.pipex.com
Tue Aug 23 15:15:47 EDT 2005


Hi All,

I have a Field that is setup as a scrolling list. I can add to the 
list no problem. However I want to be able to let the user select a 
single item in the list and then press a "delete" button to delete it.

This is the code I have, on the Field:

on mouseUp
local myClickLine

put the clickLike into myClickLine
if myClickLine is not empty then
   select myClickLine
else
   select empty
end if
end mouseUp


Then on the delete button:

on mouseUp
local mySelectedLine

put the selectedLine into mySelectedLine
if mySelectedLine is not empty then
    put theSelectedLine --Dump to message box
    delete theSelectedLine
    select empty
else
   beep
end if
end mouseUp


But when I run this, the first time I selected a line it *sometimes* 
works but then it doesn't work from then on, e.g. it doesn't delete 
the line, but the message box contains line and field number as 
expected. If I manually type "delete line 1 of field 1" in the 
message box, the line gets deleted as expected.

What am I doing wrong???

Thanks a lot
Dave



More information about the use-livecode mailing list