Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Sorting Blocks

From: carl:cybercraft at: 29-Jan-2006 9:38

On Sunday, 29-January-2006 at 0:50:19 Alan Macleod wrote,
>How do you sort a block of blocks on an element other than the first? > >For example: > >db: [ > ["bob" "Smith" "12"] > ["dan" "murphy" "25"] > ["mike" "Coogan" "6"] > ] > >How do I sort by last name or by age
Use SORT's COMPARE refinement. ie... sort/compare db func [a b][a/2 < b/2] sort/compare db func [a b][(to-integer a/3) < to-integer b/3] -- Carl Read.