Deleting lines in a scrolling list box?

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Nov 28 05:31:07 EST 2006


Hi Scott,

No global variables needed and only one button with one mouseUp handler:

on mouseUp
   if the hilitedLine of fld 1 is not empty then
     delete line (the hilitedLine of fld 1) of fld 1
   else
     beep
   end if
end mouseUp

(Replace "fld 1" with a reference to your field).

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz

Op 28-nov-2006, om 10:54 heeft Scott Kane het volgende geschreven:

> I've got a nice little scrolling list box working nicely (many  
> thanks to the ever patient Eric), but I'm having trouble with  
> deleting the line.  It seems to work sometimes and not others - and  
> even then not on all lines.  The code I'm trying to wring out is  
> below:
>
> -- This handler is in the scrolling list field
>
> on mouseUp
>  global y
>  put the clickline into y
> end mouseUp
>
> -- This handler is in a button called Delete
>
> on mouseUp
>  global y
>  put the number of lines of fld "Species List" into MyLines
>  if MyLines > 1 then
>      Delete y else
>    Put Empty into fld "Species List"
>    end if
> end mouseUp
>
> I know there has got to be a drop dead simple way of doing this!!   
> BTW - when I sort all this out I'm going to post the solutions to  
> these pesky objects in a stack on RevOnline.  I can't be the only  
> one stumbling here when first blundering in. <g>
>
> Scott





More information about the use-livecode mailing list