--- Sarah Reichelt <[EMAIL PROTECTED]> wrote: > OK people, what's the fastest way to reverse the > order of lines in a > list. I have a list of images gathered together by > filtering matching > files from a set of folders. Now I want to be able > to reverse the > order, but their file names are varied and so I have > no obvious way to > sort them. > > I realise I could just use a repeat for each loop > and put each one > before a new list variable, but that seems rather > clumsy, and using > "before" slows down when I have thousands of > records. > > I'm hoping that Jacque will chime in with one of her > custom sort ideas > that I never can think of, but anyone is welcome to > come up with some > elegant solution. > > Cheers, > Sarah >
Hi Sarah, Beating Jacque to it with this: ## local sLineCount, sCurrentLine on mouseUp put 0 into sCurrentLine put the number of lines in field 1 into sLineCount sort field 1 by ReverseOrder() end mouseUp function ReverseOrder add 1 to sCurrentLine return sLineCount - sCurrentLine end ReverseOrder ## How fast it is for huge datasets, I'm not sure; but it works a treat :-) Hope this helped, Jan Schenkel. Quartam Reports & PDF Library for Revolution <http://www.quartam.com> ===== "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld) ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com _______________________________________________ use-revolution mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
