Eliminate doubles in a long list field

Yennie at aol.com Yennie at aol.com
Sat Jun 28 19:12:01 EDT 2003


Here's one more...

Slower than the keys() version, but keeps the original order of the unique 
lines.

function removeDoubles1 theLine
   put theLines into temp
   replace cr with tab&"x"&cr in theLines
   put tab&"x"&cr after theLines
   split theLines using cr and tab
   put empty into output
   repeat for each line l in temp
     if (theLines[l] is "x") then 
       put l&cr after output
       delete local theLines[l]
     end if
   end repeat
   delete last char of output
   return output
end removeDoubles


------------------------------
Brian Yennie
Chief Technology Officer
QLD Learning, LLC
www.QLDLearning.com

PH: (904)-997-0212
EMAIL: Yennie at aol.com
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030628/3acb0d3e/attachment.html>


More information about the use-livecode mailing list