sorting a container by multiple items?

Jim Ault JimAultWins at yahoo.com
Wed May 3 18:03:53 EDT 2006


I think it will work this way

sort lines of fld "userTasks" by item 2 of each
sort lines of fld "userTasks" by item 15 of each

Seems to work this way

get fld userTasks
sort lines in it by buildSortFld(item 2 of each, item 15 of each)
put it

--this may give a different result than the first method, depending on
numeric, etc.

Jim Ault
Las Vegas

On 5/3/06 2:48 PM, "Josh Mellicker" <josh at dvcreators.net> wrote:

> I'm trying to sort the lines of a container by one, then another
> item... so I'm using a function to concatenate two fields:
> 
> 
> sort lines of fld "userTasks" by
> 
> 
> function buildSortFld f1, f2
>      return f1 && f2
> end buildSortFld
> 
> 
> This doesn't work because I need an "of each" so the sort function
> does all the lines... but wherever I put "for each", I get an error...
> 
> Where do you put "of each"?
> 





More information about the use-livecode mailing list