Sorting lines on colour (color for some)

Peter Haworth pete at lcsql.com
Thu Sep 18 14:26:08 EDT 2014


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.douez at gmail.com> wrote:

> 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 getHtmlColors
>
> Thierry
>
> ------------------------------------------------
> Thierry Douez - http://sunny-tdz.com
> Maker of sunnYperl - sunnYmidi - sunnYmage
>
>
> 2014-09-18 18:46 GMT+02:00 Francis Nugent Dixon <effendi at wanadoo.fr>:
> > 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
>
> _______________________________________________
> 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