On 4/30/05 6:02 PM, Roger Guay 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?
If you want to twist your brain in knots, you can sort using a function:
local lKeyData, lLineCounter
on sortBy keyField -- parallel sorting of linked flds
put fld keyField into lKeyData
put "data1,data2,data3" into dataFields -- fill in your fld names here
repeat with i = 1 to the number of items of dataFields
put 0 into lLineCounter -- must be reset prior to each sort
sort lines of fld (item i of dataFields) by key()
end repeat
end sortBy
function key
add 1 to lLineCounter
return line lLineCounter of lKeyData
end key
Based on an old HyperCard script by Brett Sher.
--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software | http://www.hyperactivesw.com
_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution