Array key paths

Dick Kriesel dick.kriesel at mail.com
Wed Nov 13 04:45:18 CET 2013


On Nov 12, 2013, at 1:46 PM, Monte Goulding <monte at sweattechnologies.com> wrote:

> <snip/>
> Apparently this was in some release notes from long ago.
> <snip>



Begin forwarded message:

> From: Dick Kriesel <dick.kriesel at mail.com>
> Subject: Re: Passing parameters by reference
> Date: March 12, 2012 at 1:18:47 PM PDT
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> 
> On Mar 12, 2012, at 10:19 AM, Pete wrote:
> 
>> I'm wondering how you found about about this key values array feature?  I
>> can't find any mention of it in the dictionary or the reference manual and
>> it sure seems like something that should be known!
> 
> I found it while looking through bug reports for arrays, in <http://quality.runrev.com/show_bug.cgi?id=7166> dated 2008-11-28.  So, thanks be to Mark Waddingham and David Bovill for that.
> 
> For convenience, here's Mark's reply to David:
> 
> Thanks for the suggestion.
> 
> This is on the list to include for the next version. In that version with:
>   put tValue into tArray[tKey]
> (indeed anywhere you can currently do tArray[tKey])
> 
> The meaning of 'tKey' will be extended:
>   1) If it is a string then it is as it is now
>   2) If it is a numerically keyed array starting at 1, then it will mean:
>        put tValue into tArray[tKey[1]][tKey[2]]...[tKey[n]]
>      where <n> is the number of elements in tKey
>   3) Otherwise it is an error.
> 
> This will allow you to construct an array containing the path to the key you
> want to modify/fetch/delete dynamically.
> 
> I agree, the feature's worth adding into the dictionary and manual.
> 
> -- Dick



More information about the use-livecode mailing list