Sort question

Ben Rubinstein benr_mc at cogapp.com
Sun Oct 3 11:12:18 EDT 2010


On 03/10/2010 15:39, Colin Holgate wrote:
> Ben, wouldn't yours just end up with it sorted the second way?
>
> Mark's does work if you use&

No, because Rev doesn't move lines if they have the same value on the sort 
expression.  So two sort commands in succession have the desired effect - the 
first establishes a secondary sort, the second imposes the primary sort.

Jean	13/01/2017
Luc	03/07/2017
Bern	02/09/2015
Michel	06/01/2018
Bert	01/06/2016
Jo	13/02/2016
Rob	26/03/2018
Nick	15/01/2015

is sorted as

Michel	06/01/2018
Jean	13/01/2017
Nick	15/01/2015
Jo	13/02/2016
Rob	26/03/2018
Bert	01/06/2016
Luc	03/07/2017
Bern	02/09/2015


However as Yves points out it would be better to have replaced "word 2 of 
each" with "last word of each".

Mark's does indeed work (if his fingers hadn't misrepresented what his mind 
knew) and is probably faster - but depends on having zero padding of the 
month/date so that alpha sorting will equate to numeric sorting.

slogan "Rev^H^H^H  LiveCode: more ways to skin every cat"!

Ben



More information about the use-livecode mailing list