arrays with merge

Mike Bonner bonnmike at gmail.com
Fri Jun 5 09:42:18 EDT 2015


As ali said, the unquoted key is only an issue if there is a declared
variable, at which point the key becomes whatever is in that variable. (or
if its a keyword of course)

I use the "store the string elsewhere" method.  When creating merge strings
for later use, I either create them using the property inspector, or put
them into a field and set a property to the field.

The other option mentioned is pretty helpful.  Put in an unquoted key, and
set the value of it as a variable.  This can be pretty handy because you
can change which key you want to look at on the fly.

On Fri, Jun 5, 2015 at 3:32 AM, Ali Lloyd <ali at runrev.com> wrote:

> Yes, that is LiveCode 'unquoted literal' mechanism -
>
> It is the same as, for example, (if you have strict compilation off)
>
> *put* tTest & "sdfsdf" -- puts tTestsdfsdf into the message box
>
>
> When a variable has not been declared, any tokens that are not keywords are
> treated as strings.
>
> On 5 June 2015 at 10:26, Terence Heaford <t.heaford at icloud.com> wrote:
>
> > Interestingly it works without quotes around test.
> >
> > It does work but should it?
> >
> > This suggests the only reason for quotes in array keys is in case you
> have
> > a two word key?
> >
> > put merge("SELECT [[tColumns]] FROM '[[tTable]]' [[myArray[test]]]
> > [[tSortOrder]]") into tSQL
> >
> >
> > All the best
> >
> > Terry
> >
> > > On 5 Jun 2015, at 10:13, Ali Lloyd <ali at runrev.com> wrote:
> > >
> > > put merge("SELECT [[tColumns]] FROM '[[tTable]]' [[myArray["test"]]]
> > > [[tSortOrder]]") into tSQL
> > >
> > > doesn't work is  the double quote around "test". Merge should work fine
> > > with arrays (I should know because bug 11274 was one of the first I
> ever
> > > fixed!)
> > >
> > > You can either use & and quote to build the correct string
> >
> > _______________________________________________
> > 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