[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sorting arrays



On Fri, 18 Jun 1999, Peter Westlake wrote:

> Even if the attempted substitution worked, swapping "||" for ","
> doesn't affect the sorting. I think it is clear that the names
> should be sorted alphabetically by first one name and then the
> other, *not* by alphabetical order of concatenating them.
> 
Yes, but you can accomplish that in other ways rather than splitting the
two. The S.T. I alluded to in a previous post uses sprintf() in place of
split to make a single string with left-justified and aligned surname and
firstname (with some guessing as to max allowable widths for each). That
way the sort inside the S.T. is extremely simple.

I'm not saying this is the way to go, but using sprintf() is comparable in
speed to using split() (in this problem).

Arved



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org