The merge function is awesome!

Tom Glod tom at makeshyft.com
Thu Jan 17 17:27:10 EST 2019


6 years with LC...never used the value or merge commands ..... never even
came across them.

mind blown.

On Thu, Jan 17, 2019 at 3:46 PM Geoff Canyon via use-livecode <
use-livecode at lists.runrev.com> wrote:

> On Thu, Jan 17, 2019 at 11:01 AM hh via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
> > > Geoff wrote:
> > > ... you've just given me an idea how to handle things like font/styling
> > > tags. Something like:
> > > function ifTag b,o,s,c
> > >     if b then return o & s & c else return s
> > > end ifTag
> >
> > Allow me two remarks.
> >
> > 1. You could use, in order to avoid the check:
> >
> > function tag s,o,c
> >     return o & s & c
> > end tag
> >
> > And both, tag("inner") and tag("inner","left-","-right") work.
> >
>
> I'm thinking about situations where the tags are optional, so something
> like:
>
> ifTag(word 1 of tID is "group","<b>",the name of tID,"</b>")
>
> I'd have to do a timing test to see whether it's more costly to do the
> function call or perform the test twice. And of course in this instance it
> would be easy enough to simply use:
>
> <?if word 1 of tID is "group" then return "<b>", & the name of tID & "</b>"
> else return the name of tID?>
>
> But it would become unwieldy for more complex strings.
>
> >
> > 2. Also array-things work with merge, like [[a[1]]].
> >
>
> Yep, definitely planning to take advantage of this if possible:
> https://github.com/gcanyon/navigator/issues/21
> _______________________________________________
> 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