sorting table fields

Jim Ault JimAultWins at yahoo.com
Wed Dec 20 12:50:20 EST 2006


On 12/20/06 2:02 AM, "Viktoras Didziulis" <viktoras at ekoinf.net> wrote:
>  
> are there any simple ways to do sort in table fields in Revolution like
> first sort by column A, then by column B, then by C... In a way it is done
> in MS Excell or Sun's Open Office spreadsheet... It is also quite
> straightforward in SQL, what about RevScript?
>  
Sorting is cumulative in Rev so
Phil^Johnson^clerk^42

--alphabetical by LN, FN, department number
set the itemdel to tab
sort fld userListing ascending numeric by item 4 of each
sort fld userListing descending by item 1 of each
sort fld userListing descending by item 2 of each

--by item 4 of each means ...
using item 4 of each line as the sort value

You could be more compact if the table was organized by doing
sort fld userListing descending by item 2 to 3 of each
--but that probably won't get you what you want

Hope this helps

Jim Ault
Las Vegas





More information about the use-livecode mailing list