List all Custom Properties in a stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: List all Custom Properties in a stack
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: List all Custom Properties in a stack
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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: List all Custom Properties in a stack
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 was not comparing a field to the widget, rather a field to the display in the variable pane in the SE in debug mode:
CraigI 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.
-
- VIP Livecode Opensource Backer
- Posts: 138
- Joined: Tue Feb 23, 2010 10:53 pm
- Location: Saint Louis, Missouri USA
Re: List all Custom Properties in a stack
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
All of the code is in the one button. Easy.
FYI,
Bob
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: List all Custom Properties in a stack
I have done that as well.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: List all Custom Properties in a stack
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
Mark
- Attachments
-
- Try It.livecode.zip
- (2.07 KiB) Downloaded 88 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 138
- Joined: Tue Feb 23, 2010 10:53 pm
- Location: Saint Louis, Missouri USA
Re: List all Custom Properties in a stack
Mark:
Nice comparison of the two approaches.
Thanks,
Bob
Nice comparison of the two approaches.
Thanks,
Bob
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: List all Custom Properties in a stack
Does the Script Editor list object properties?dunbarx wrote: ↑Sat Jul 30, 2022 11:41 pmRichard.
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:
CraigI 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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: List all Custom Properties in a stack
Richard.
Hmmm.
If you:
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
Hmmm.
If you:
Code: Select all
put the customProperties of this stack into temp
breakpoint
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
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: List all Custom Properties in a stack
dunbarx wrote: ↑Wed Aug 03, 2022 7:33 pmCraigCode: Select all
put the customProperties of this stack into temp breakpoint
Wow, how have a I lived so long without knowing about that command???
Thank you.
M
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 138
- Joined: Tue Feb 23, 2010 10:53 pm
- Location: Saint Louis, Missouri USA
Re: List all Custom Properties in a stack
This command will retrieve the full array of data, at all levels, in the current (default) "customKeys" Set.put the customProperties of this stack into temp
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: List all Custom Properties in a stack
Mark.
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
Do you mean the "combine" command? The code snippet you posted did not mention that.how have a I lived so long without knowing about that command???
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
-
- VIP Livecode Opensource Backer
- Posts: 7266
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: List all Custom Properties in a stack
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.Other custom Sets, like cREVGeneral, will be displayed but the default customKeys Set will not be listed.
To list all the sets you can get the empty one and concatenate it with the others.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: List all Custom Properties in a stack
I think it a minimum of civility to, at last, give it a name.
I mean, cummon, team.
Craig
I mean, cummon, team.
Craig