Gossamer Forum
Home : Products : DBMan : Installation :

Sorting question

Quote Reply
Sorting question
Hello,

DBman currently has this two sorting functions:

sub alpha_ascend { lc($sortby{$a}) cmp lc ($sortby{$b}) }
sub alpha_descend { lc($sortby{$b}) cmp lc ($sortby{$a}) }

which sorts an alphanumeric string in either ascending or descending order. This is fine but, how can I sort the following strings "ONLINE, CLOSED, ANSWERED" so that

ONLINE is first
ANSWERED is second
CLOSED is third

Ascending would give me ANSWERED, CLOSED, ONLINE and descending the opposite so I need to figure out some sort of sort function that does the trick for me...

Thanks
-JO
Subject Author Views Date
Thread Sorting question Jaime Ortega 2871 Apr 19, 1999, 8:18 AM
Post Re: Sorting question
JPDeni 2795 Apr 18, 1999, 9:14 PM
Post Re: Sorting question
Jaime Ortega 2804 Apr 19, 1999, 10:39 PM
Post Re: Sorting question
JPDeni 2787 Apr 20, 1999, 5:58 AM
Post Re: Sorting question
JPDeni 2793 Apr 20, 1999, 9:42 PM
Post Re: Sorting question
Jaime Ortega 2791 Apr 21, 1999, 1:09 AM
Post Re: Sorting question
Jaime Ortega 2801 Apr 23, 1999, 1:11 AM
Post Re: Sorting question
JPDeni 2794 Apr 23, 1999, 6:52 AM