Sorting Multiple Fields

Ken Ray kray at sonsothunder.com
Sat Apr 30 20:36:18 EDT 2005


On 4/30/05 6:02 PM, "Roger Guay" <irog at mac.com> wrote:

> I have 6 list fields side-by-side each with the same number of
> lines,  with synchronized scrolling and synchronized hilitedLines.
> Is there an easy way to sort the first field and have the data in the
> other fields follow the sort.  That is to sort the whole group on the
> first field?

Easiest way is to use a single field with tabstops set for the different
columns. That way, it's all in one field and can be sorted like this:

put fld "Data" into tData
set the itemDel to tab
sort lines of tData by item 1 of each
put tData into fld "Data"

Or, if you don't have a lot of data, you can do it directly with the field:

sort lines of fld "Data" by item 1 of each

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list