Reversing a list

Sarah Reichelt sarah.reichelt at gmail.com
Wed Apr 23 00:04:17 EDT 2008


On Fri, Apr 4, 2008 at 10:14 AM, Sarah Reichelt
<sarah.reichelt at gmail.com> wrote:
> And the winner is.......
>
>  Jacque (with one modification).
>
>  local tCount
>
>  function reverseList pList
>     put the number of lines in pList into tCount
>     sort lines of pList by mySort()
>     return pList
>  end reverseList
>
>  function mySort
>     subtract 1 from tCount
>     return tCount
>  end mySort

OK, this realised this working for me and I finally figured out what
was going on - the sort needs to be numeric!
So change the "sort" line to this:

     sort lines of pList numeric by mySort()

Cheers,
Sarah



More information about the use-livecode mailing list