Reverse a list

Mark Wieder mwieder at ahsoftware.net
Mon Feb 9 17:04:22 EST 2015


Sorry - got one line out of place. Here ya go.
Still the fastest yet.

function arevers p
   local t
   local tNumElems
   
   put the number of lines in p into tNumElems
   split p by cr
   put empty into t
   repeat for each line l in p
      put p[tNumElems] & cr after t
      subtract 1 from tNumElems
   end repeat
   return t
end arevers

-- 
 Mark Wieder
 ahsoftware at gmail.com






More information about the use-livecode mailing list