deleting lines in a field

Geoff Canyon gcanyon at gmail.com
Mon Oct 27 11:39:59 EDT 2014


Depending on the size of your data, something like this could be (much)
faster:

function removeLines lineList,S
   put 0 into lineCounter
   split lineList with comma as set
   repeat for each line L in S
      add 1 to lineCounter
      if lineList[lineCounter] then next repeat
      put L & cr after R
   end repeat
   return char 1 to -2 of R
end removeLines

This will test it, putting the non-hilited lines of fld 2 into fld 1:

on mouseUp
   put removeLines(the hilitedLines of fld 2,fld 2) into fld 1
end mouseUp


On Sun, Oct 26, 2014 at 4:10 AM, <larry at significantplanet.org> wrote:

> I have a field that allows non-contiguous selection of lines
>
> What is the easiest way to delete the selected lines?
>
> I've tried a bunch of things and I end up doing this big convoluted script
> to do it.  It seems like it should be simple?
>
> Thanks, Larry
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list