Mark,
I will start doing this. I have a headache just thinking of the last time I
had some complex keys and trying to read the code with the afore mentioned
quotes and ampersands. Learn something new every day. 

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 Mark Waddingham via use-livecode
Sent: Thursday, May 11, 2023 10:51 AM
To: How to use LiveCode
Cc: Mark Waddingham
Subject: Re: generate an Array using value for naming the keys?

On 2023-05-11 15:47, matthias rebbe via use-livecode wrote:
> Mark, thank you very much!
> 
> i didn't know or remember that the key name of an array can be created 
> directly using strings and variables
> 
> Maybe i even did that in the past, but could not remember anymore. I 
> really thought i have solved it that time with value()  :)

No problem - of course, I used & in my example - but when I'm doing stuff
like that I tend to use format:

put tFoo[format("wp_%s_%s", tMiddlePart, tSuffix)] into
tMiddlePartSuffixValue

It does the same job, but I find it more readable (as the structure of the
string can be seen immediately without having to wade through quotes and
ampersands :)

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things

_______________________________________________
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

Reply via email to