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
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