arrays with merge

Ali Lloyd ali at runrev.com
Fri Jun 5 05:13:59 EDT 2015


Hi,

The reason
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

put merge("SELECT [[tColumns]] FROM '[[tTable]]' [[myArray[" & quote & test
& quote & "]]] [[tSortOrder]]") into tSQL

 or put "test" into a variable beforehand

local tTest
put "test' into tTest
put merge("SELECT [[tColumns]] FROM '[[tTable]]' [[myArray[tTest]]]
[[tSortOrder]]") into tSQL

Ali


On 5 June 2015 at 08:21, Lyn Teyla <lyn.teyla at gmail.com> wrote:

> > function myArray pString
> >   return myArrayTest[pString]
> > end myArray
>
> Small typo:
>
> myArrayTest[pString]
>
> should of course be:
>
> myArray[pString]
>
>
>
> _______________________________________________
> 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