Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 823

Getting Started with LiveCode - Complete Beginners • Custom Properties and nested arrays

$
0
0
Hi all,

I've read a whole lot of forum posts about custom properties over the last couple of weeks so I'm fine with things such as

set the cCurrentWeather of this stack to "Sunny"

and

put the cCurrentWeather of this stack etc

What I'm now trying to do is find a way to reference nested arrays. I can manually create the nesting levels just fine, but I'm struggling to find a way to interact with them programatically both to set values and retrieve values.

Here's a sample set of manually created custom properties
customPropTest.jpg
So the nested custom property array is called animals and has sub-types of cat and dog. Each sub type contains the pet name and their preferred food. What I'd like to be able to do is add a new animal to the nested array along with their preferred food, and also do a queries on the custom properties to retrieve all the cats names or the dogs names, or see what food animals>dog>scoooby likes to eat for example. Now, this is just a test stack to see how it all works and yes I know I could do this with a sqlite database too.

While playing around with the above I've found an alternate method which is kind of ok. I created two other customPropertySets: one for cats and one for dogs then stored the pet name and preferred food within those. I don't mind using customProperties this way, but it bugs me that I can create a nested array in the standard customProperties but I can't find a way to work with them through LC.

Is there a magic way to delve down into the nested levels of these custom properties??????

Thanks for any pointers and help

Al.

Statistics: Posted by j9v6 — Wed May 08, 2024 10:28 am



Viewing all articles
Browse latest Browse all 823

Trending Articles