Sorting lines
Jan Schenkel
janschenkel at yahoo.com
Tue May 29 13:59:24 EDT 2007
--- Martin Baxter <mb.userev at harbourhosting.co.uk>
wrote:
> > Hi Matthias,
> >
> > Try the following:
> > ##
> > set the itemDelimiter to ";"
> > sort lines of tVariable by item 4 of each
> > ##
> >
> > Hope this helped,
> >
> > Jan Schenkel.
>
> Erm, this doesn't seem to work here in 2.8.1 on win
> XP. The
> itemdelimiter appears to be ignored.
>
> Martin Baxter
>
Hi Martin,
As the itemDelimiter is a local propert and thus gets
reset at the end of a running handler, you have to run
both lines together from a script, or in the
multi-line section of the message box.
I tested it on MacOSX in Rev 2.6.1 and 2.8.1, and it
worked in both:
- I pasted the example text into a field:
##
320;4999;219;Peter;329;366
3;23;14;Mark;0;0
2;213;13;Josh;215;666
1000;999;10101;Mark;211;555
2;214;25;Peter;212:667
##
- And added a button with the following script:
##
on mouseUp
put field 1 into tVariable
sort lines of tVariable by random(10000)
set the itemDelimiter to ";"
sort lines of tVariable by item 4 of each
put tVariable into field 1
end mouseUp
##
When clicking a few times, you may end up with
different results, but the 'Josh', 'Mark' and 'Peter'
lines are still lumped together.
Hope this helped,
Jan Schenkel.
Quartam Reports for Revolution
<http://www.quartam.com>
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
____________________________________________________________________________________Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
More information about the use-livecode
mailing list