Page 2 of 4

Re: List all Custom Properties in a stack

Posted: Sat Jul 30, 2022 8:24 pm
by dunbarx
One might characterize the way the SE breaks out an array variable as a primitive "tree". Anyone who never has, try it. Make an array in a short handler, preferably of multiple levels and set a breakpoint right away. See how the SE (has always) done this.

I have used the SE in the past as a tool to examine array variables, as opposed to using the "combine" command and load the results into, say, a field. The difference is that a field is a far more permanent container.

Craig

Re: List all Custom Properties in a stack

Posted: Sat Jul 30, 2022 8:49 pm
by FourthWorld
dunbarx wrote: Sat Jul 30, 2022 8:24 pm I have used the SE in the past as a tool to examine array variables, as opposed to using the "combine" command and load the results into, say, a field. The difference is that a field is a far more permanent container.
How is the field more permanent than the tree widget?

In either case you drop them on a card, populate them with data, and if you save the stack the data stored in the objects within it remains.

What am I missing?

Re: List all Custom Properties in a stack

Posted: Sat Jul 30, 2022 11:41 pm
by dunbarx
Richard.

I was not comparing a field to the widget, rather a field to the display in the variable pane in the SE in debug mode:
I have used the SE in the past as a tool to examine array variables, as opposed to using the "combine" command and load the results into, say, a field.
Craig

Re: List all Custom Properties in a stack

Posted: Sun Jul 31, 2022 1:59 am
by bobcole
Here is the same example from earlier (see above) but I added two Tree View widgets to display my two custom property sets.
All of the code is in the one button. Easy.
FYI,
Bob
CustomPropertiesExampleTreeView.livecode.zip
(2.04 KiB) Downloaded 321 times

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 12:46 pm
by marksmithhfx
dunbarx wrote: Sat Jul 30, 2022 8:24 pm I have used the SE in the past as a tool to examine array variables, as opposed to using the "combine" command and load the results into, say, a field. The
Craig
I have done that as well.

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 1:32 pm
by marksmithhfx
Here's an example that compares the tree view widget to the displayArrayData(pArray, pIndent) function. Very different approaches to displaying array data but both have their uses. Data is from from this lesson https://lessons.livecode.com/m/4071/l/2 ... dable-form

Mark

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 5:14 pm
by bobcole
Mark:
Nice comparison of the two approaches.
Thanks,
Bob

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 7:10 pm
by FourthWorld
dunbarx wrote: Sat Jul 30, 2022 11:41 pm Richard.

I was not comparing a field to the widget, rather a field to the display in the variable pane in the SE in debug mode:
I have used the SE in the past as a tool to examine array variables, as opposed to using the "combine" command and load the results into, say, a field.
Craig
Does the Script Editor list object properties?

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 7:33 pm
by dunbarx
Richard.

Hmmm.

If you:

Code: Select all

put the customProperties of this stack into temp
breakpoint
You can see that the SE shows the array variable "temp", open for inspection in a sort of "tree" view. It does not matter how many layers deep each one is, all are available.

The only other way to do this is to take the array variable 'temp" and apply the "combine" command to change it into an "ordinary" variable, which one might then load into a field and examine it.

I am sure we are not communicating well...

Craig

Re: List all Custom Properties in a stack

Posted: Wed Aug 03, 2022 10:16 pm
by marksmithhfx
dunbarx wrote: Wed Aug 03, 2022 7:33 pm

Code: Select all

put the customProperties of this stack into temp
breakpoint
Craig

Wow, how have a I lived so long without knowing about that command???

Thank you.
M

Re: List all Custom Properties in a stack

Posted: Thu Aug 04, 2022 3:01 am
by bobcole
put the customProperties of this stack into temp
This command will retrieve the full array of data, at all levels, in the current (default) "customKeys" Set.

If you have created other Sets of custom properties outside of the customKeys Set, they will not be displayed.
According to the dictionary, to identify other Sets, if any, try this:

Code: Select all

get the customPropertySets of this stack --or other object
breakpoint
and look at the it variable in the Script Editor. Other custom Sets, like cREVGeneral, will be displayed but the default customKeys Set will not be listed.

I'm going to consider making my custom property sets as sub-sets of the default "customKeys" Set.
That way, the command at the top of this reply will give me everything at once.
Interesting discussion; further research...
Thanks,
Bob

Re: List all Custom Properties in a stack

Posted: Thu Aug 04, 2022 4:18 am
by dunbarx
Mark.
how have a I lived so long without knowing about that command???
Do you mean the "combine" command? The code snippet you posted did not mention that.

Anyway, if so, worth playing with, and be sure to fool around with the delimiters, as they are very helpful in "seeing" what is going on in the resultant display.

And further, assuming it really was the combine command, know that the "opposite" of that is the "split" command.

Craig

Re: List all Custom Properties in a stack

Posted: Thu Aug 04, 2022 5:51 pm
by jacque
Other custom Sets, like cREVGeneral, will be displayed but the default customKeys Set will not be listed.
This is due to historical reasons. Back in ancient times there were no custom property sets, we only had one default set. It had no name, and still doesn't, which is why to use it you set the customPropertySet to empty.

To list all the sets you can get the empty one and concatenate it with the others.

Re: List all Custom Properties in a stack

Posted: Thu Aug 04, 2022 9:09 pm
by dunbarx
I think it a minimum of civility to, at last, give it a name.

I mean, cummon, team.

Craig

Re: List all Custom Properties in a stack

Posted: Fri Aug 05, 2022 12:49 pm
by Cairoo
dunbarx wrote: Thu Aug 04, 2022 9:09 pm I think it a minimum of civility to, at last, give it a name.

I mean, cummon, team.

Craig
No, please team, don't listen to Craig. It would break my apps. :P