5,4,3,2,1.... Here comes Peter with "Always use strict compilation mode" Followed by my +1
Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -----Original Message----- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Mike Bonner Sent: Friday, June 05, 2015 9:42 AM To: How to use LiveCode Subject: Re: arrays with merge 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 <a...@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.heaf...@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 <a...@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode