Re: Sorting lines on colour (color for some)

2014-09-20 Thread Francis Nugent Dixon
Hi from beautiful Brittany, Jacqueline, I was already in a repeat loop to colour lines which contained certain field names, so I just tacked in the addition of the RGB, and then sorted the field. Then I added a three line repeat loop to remove the RGB data, and got what I wanted. So I found,

Re: Sorting lines on colour (color for some)

2014-09-19 Thread Francis Nugent Dixon
Hi from Beautiful Brittany, Thanks to all you guys (and Jacqueline) for the wealth of suggestions to solve my little problem. That’s a lot of brain power out there. I had thought of tacking the colour code onto each line, sorting by the normal way, and then stripping off the code. But I knew

Re: Sorting lines on colour (color for some)

2014-09-19 Thread BNig
Hi Mike, I like your idea to use styledText very much. It turns out that for the backgroundColor of a line it is not too bad to handle. --- local sCounter = 0 local sStyles = on mouseUp put 0 into sCounter put the styledText of field fData into

Re: Sorting lines on colour (color for some)

2014-09-19 Thread J. Landman Gay
On 9/18/2014, 4:46 PM, dunb...@aol.com wrote: Anyway, the backColor does not sort either, using the same code. Jacque, why doesn't the thing sort? I think it's because when you sort lines, the engine pulls out only the actual text of the line for sorting. It isn't looking at the properties

Re: Sorting lines on colour (color for some)

2014-09-19 Thread Peter Haworth
QCC Report# 13492 submitted as an enhancement. I doubt it will get a very high priority but thought it worth documenting. Pete lcSQL Software http://www.lcsql.com Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and SQLiteAdmin http://www.lcsql.com/sqliteadmin.html On Fri, Sep

Re: Sorting lines on colour (color for some)

2014-09-19 Thread dunbarx
: Fri, Sep 19, 2014 3:23 pm Subject: Re: Sorting lines on colour (color for some) On 9/18/2014, 4:46 PM, dunb...@aol.com wrote: Anyway, the backColor does not sort either, using the same code. Jacque, why doesn't the thing sort? I think it's because when you sort lines, the engine pulls out

Re: Sorting lines on colour (color for some)

2014-09-19 Thread J. Landman Gay
On 9/19/2014, 8:18 PM, dunb...@aol.com wrote: OK, I get that. But then how would a function, something you in particular are fond of, work? In this case I wouldn't use any field access, it would be inefficient and slow for all but very short field contents. But if someone put a knife to my

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Mark Schonewille
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

Re: Sorting lines on colour (color for some)

2014-09-18 Thread dunbarx
-talk.com To: How to use LiveCode use-livecode@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

Re: Sorting lines on colour (color for some)

2014-09-18 Thread dunbarx
To: use-livecode use-livecode@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

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Phil Davis
: 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

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Peter Haworth
I thought this would work: sort lines of field X by the backgroundcolor of each ... but it doesn't. I'm guessing because the lines go into some sort of internal variable to be sorted at which point they lose their backgroundcolor property. Here's a handler that does it, offered for improvement

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Thierry Douez
Another one with some regex flavor on mouseUp local t put the htmltext of fld 1 into t sort lines of t by getHtmlColors( each) set the htmltext of fld 1 to t end mouseUp function getHtmlColors L if matchText( L, p bgcolor=.#([0-9A-F]{6})., v) then return v return z end

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Peter Haworth
Like that better than mine - good use of htmltext and regex! Pete lcSQL Software http://www.lcsql.com Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and SQLiteAdmin http://www.lcsql.com/sqliteadmin.html On Thu, Sep 18, 2014 at 11:01 AM, Thierry Douez th.do...@gmail.com wrote:

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Thierry Douez
2014-09-18 20:26 GMT+02:00 Peter Haworth p...@lcsql.com: Like that better than mine - good use of htmltext and regex! Pete Thanks Peter, and for those having real headacke with regex, you can write the function this way: function getHtmlColors L if offset( p bgcolor=, L) 1 then return z

Re: Sorting lines on colour (color for some)

2014-09-18 Thread dunbarx
prettier. Craig -Original Message- From: Thierry Douez th.do...@gmail.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Thu, Sep 18, 2014 3:56 pm Subject: Re: Sorting lines on colour (color for some) 2014-09-18 20:26 GMT+02:00 Peter Haworth p...@lcsql.com: Like that better

Re: Sorting lines on colour (color for some)

2014-09-18 Thread J. Landman Gay
On 9/18/2014, 3:06 PM, dunb...@aol.com wrote: Peter, you need foreground color, not backgroundColor. So again, before I call Jacque, why does this not work? I think backgroundColor really is what you want. Lines can have their own backcolor, forecolor is the color of the text. --

Re: Sorting lines on colour (color for some)

2014-09-18 Thread dunbarx
18, 2014 5:18 pm Subject: Re: Sorting lines on colour (color for some) On 9/18/2014, 3:06 PM, dunb...@aol.com wrote: Peter, you need foreground color, not backgroundColor. So again, before I call Jacque, why does this not work? I think backgroundColor really is what you want. Lines can have

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Peter Haworth
My script works with background color so I guess that must be the right property. It would be great if something like sort lines of field x by the backgroundcolor of each just worked though. Not just with backgroundcolor but with any property of a line in a field. Worth an enhancement request?

Re: Sorting lines on colour (color for some)

2014-09-18 Thread Mike Bonner
...@hyperactivesw.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Thu, Sep 18, 2014 5:18 pm Subject: Re: Sorting lines on colour (color for some) On 9/18/2014, 3:06 PM, dunb...@aol.com wrote: Peter, you need foreground color, not backgroundColor. So again, before I call Jacque