New Message: Re: list sorting

webmaster at userland.com webmaster at userland.com
Thu Oct 25 23:47:33 PDT 2001


A new message was posted:

Address: http://frontier.userland.com/discuss/msgReader$9025

By: Thomas A. Creedon (thomas at creedon.net)

Hello Dan,

I use tables to do sorting. They are much faster than outlines.

Something like the following might work.

on listBuilder(path) {
 local (adr);
 local (textAdr = ("raw_" + random (1,9999) + clock.ticks()));
 local (workList = "");
 new (tableType, @suites.pagetracker.diskbuilder.data.[textAdr]);
 on add (s) {
 workList = workList + s + cr};
 fileloop (f in path) {
 if string.mid(file.filefrompath(f),1,1) != "." {
 if file.isfolder(f) {
 suites.pagetracker.diskbuilder.data.[textAdr].[file.filefromPath(f)] = nil}}};
 for adr in @suites.pagetracker.diskbuilder.data.[textAdr] {
 add (nameOf (adr^))};
 delete(@suites.pagetracker.diskbuilder.data.[textAdr]);
 return (workList)};
You can get fancier by walking the table backwards, or use the Value column and sort on it.

Toodle-loooooooo..........
Thomas

editHere.com [1] website hosting service. "Websites as easy as see it, edit it, save it! TM"

<http://weblog.creedon.net/

[1] http://www.editHere.com/

This is a Manila site.. http://manila.userland.com/.





More information about the Frontier-Server mailing list