Sorting lines on colour (color for some)
dunbarx at aol.com
dunbarx at aol.com
Thu Sep 18 13:32:23 EDT 2014
Should better have been (though still not working):
on mouseUp
sort lines of fld 1 numeric by item 1 of the foregroundColor of each & item 2 of the foregroundColor of each & item 3 of the foregroundColor of each
end mouseUp
-----Original Message-----
From: dunbarx <dunbarx at aol.com>
To: use-livecode <use-livecode at lists.runrev.com>
Sent: Thu, Sep 18, 2014 1:24 pm
Subject: Re: Sorting lines on colour (color for some)
Well, I win the fewest lines prize, but surely lose in the "does it work?" category.
Anyone know why this fails?
on mouseUp
sort lines of fld 1 numeric by sum(the foregroundColor of each)
end mouseUp
Craig Newman
-----Original Message-----
From: Mark Schonewille <m.schonewille at economy-x-talk.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Thu, Sep 18, 2014 12:52 pm
Subject: Re: Sorting lines on colour (color for some)
Hi Francis,
I haven't tried this but it might work.
put the htmlText of fld x into myHtml
put char 4 to -5 of myHtml into myHtml
set the itemDel to ">"
sort lines of myHtml by item 1 of each
set the htmlText of fld x to "<p>" & myHtml & "</p>"
If this doesn't work, it might at least give a clue of how to handle
this kind of problems.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Installer Maker for LiveCode:
http://qery.us/468
Buy my new book "Programming LiveCode for the Real Beginner"
http://qery.us/3fi
LiveCode on Facebook:
https://www.facebook.com/groups/runrev/
On 9/18/2014 18:46, Francis Nugent Dixon wrote:
> Hi from Beautiful Brittany (where, finally, it is raining),
>
> I have a list in a field, with backgroundcolor of some lines red, some yellow.
> Does anybody know how to sort the lines to separate out the two colours ?
>
> I can do it using a shuffle mechanism, but it’s not elegant enough (:>) !!
>
> The sort container command doesn’t give me the impression that this is a
> one-liner …….
>
> He who uses the least lines of code will gain my immediate admiration ……
>
> —Francis
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list