Current Custom Properties setup ? [Re-Solved]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Current Custom Properties setup ? [Re-Solved]

Post by bogs » Fri Mar 15, 2019 10:39 pm

Okey doke, I cracked open 8.1.2 to contribute pictures to a project I'm playing with.

I went to the custom properties pane, and entered two custom properties, and filled them out (like this)
Selection_002.png
It is there...
Then I closed out the PI, went to the message box to send this message -

Code: Select all

set the text of field 1 of stack "help" to the custPropCredits  of stack "help"
and... nothing happened to the field. I went back into the custom properties and..... They were both blank again ?!

Did something change in the cp realm?
Last edited by bogs on Thu Mar 28, 2019 6:36 pm, edited 3 times in total.
Image

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Current Custom Properties setup ?

Post by Klaus » Fri Mar 15, 2019 10:49 pm

Hi bogs,

"custom property sets" are just like arrays!
1. looks like you did not set a KEY for your entry!
2. Then use the "usual" array syntax:

Code: Select all

set the text of field 1 of stack "help" to the custPropCredits["name_of_your_key"] of stack "help"
Or do like this:

Code: Select all

set the customPropertySet of stack "help" to "custPropCredits"
set the text of field 1 of stack "help" to the "name_of_your_key" of stack "help"
Did something change in the cp realm?
Not since the Metacard days. :-)

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Current Custom Properties setup ?

Post by richmond62 » Sat Mar 16, 2019 8:07 am

Screenshot 2019-03-16 at 9.03.06.png
-
Click on the "Key" and that should sort things out.

OR . . . "just"

Code: Select all

set the "Prawns" of btn "Button 1" to "Peeled"
and everything is done "magically" without having to fool around
with the Properties palette at all. 8)
Last edited by richmond62 on Sat Mar 16, 2019 1:53 pm, edited 1 time in total.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ?

Post by bogs » Sat Mar 16, 2019 11:54 am

Klaus wrote:
Fri Mar 15, 2019 10:49 pm
Did something change in the cp realm?
"custom property sets" are just like arrays! <sic>
Not since the Metacard days. :-)
Best
Klaus
Ah, I wasn't trying to make a 'CP set', just two simple separate CPs, heh.

Richmond, thank you for the picture, I think what changed is the layout (and meaning) of the controls in the panel, and that threw me off ...
Selection_001.png
It sticks here eh...
I don't feel so bad, least I was only doing the same thing over and over 6 times before asking Image
Image

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Current Custom Properties setup ?

Post by Klaus » Sat Mar 16, 2019 12:00 pm

AHA!
Well, I am a very visual guy and the pic showed that you were selecting a CP set actually.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ?

Post by bogs » Sat Mar 16, 2019 12:32 pm

Yah, it was a 'gotcha' for me, in all the versions I normally use, you just click the + icon at the top, then add the property. The redesign really threw me off, clicking that icon creates a 'set' now, and you have to go into the 'key' part to actually create just one property is how it works I guess.

Reversing the order of controls and setting the props in a completely different looking area, and changing all the dialogs wasn't something I was thinking had happened :?

I just love redesigns :P
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Current Custom Properties setup ?

Post by richmond62 » Sat Mar 16, 2019 1:55 pm

The thing is counter-intuitive and set me cursing a while
back when I was experimenting with custom props in
square dominos.

So, nowadays I just use the type of code I mentioned
and avoid the palette as much as possible.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ?

Post by bogs » Sat Mar 16, 2019 2:06 pm

richmond62 wrote:
Sat Mar 16, 2019 1:55 pm
So, nowadays I just use the type of code I mentioned
and avoid the palette as much as possible.
Well, normally that is how I would have approached it, in code -

Code: Select all

set the cpropMyProp of this stack to "prawns"
put the cpropMyProp of this stack into field 1
// etc
Problem is, this project ultimately isn't for me as much as a demonstration of the Lc IDE through the years, so I'm trying to centralize how much of what Lc can do can be done strictly through the IDE provided tools. They remained so consistent through the decades I just didn't count on the surprises with the new placements, it made me re-think the entire project layout I originally had :roll:
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Current Custom Properties setup ?

Post by richmond62 » Sat Mar 16, 2019 3:47 pm

a demonstration of the Lc IDE through the years
There just has to be an "agenda" behind this: do tell! 8)

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ?

Post by bogs » Sat Mar 16, 2019 4:47 pm

Probably in another week or two you'll see it posted, I'm taking my very first swipe at trying to write a tutorial, waiting on feedback from a few people.

Problem is me, really, I don't use much past 6.5 (and more often than not, I'm in Mc), but I want to make sure the code AND the parts of the IDE needed to complete the tutorial can be located through (more or less) the same directions given.

If the versions get too far apart, I may have to scrap the one generic tutorial and write 2 different tutorials instead. Problem there is, 8.x and 9.x are already starting to go really different for certain things.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9582
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Current Custom Properties setup ?

Post by dunbarx » Sun Mar 17, 2019 2:27 am


bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ?

Post by bogs » Sun Mar 17, 2019 10:59 am

dunbarx wrote:
Sun Mar 17, 2019 2:27 am
Does this have any relevance?
Ha ha ha, I had forgotten all about that thread, good one :D

Unfortunately, it was my recognition skills that failed to see the difference in setup of cps that was the problem. Klaus and Richmond set me straight already.

Also unfortunately (or maybe fortunately), I can only run up to the 8.x series on my box, 9 and up still present too many problems to overcome. I suppose I can shove them into a VM, but for the moment it isn't of great importance.
Image

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ? [Un-Solved]

Post by bogs » Wed Mar 27, 2019 3:41 pm

Mkay, so, I took another run (longest I used 8.1.2 yet) at doing the video to accompany this project.

I set the customProperties through the IDE again, this time using Richmond's picture as a guide. I then tested the line you see the debugger stopped at from the messageBox, and it worked! So I put it into the script and....
Selection_001.png
Whaaa...?
So now I am thoroughly confused. In no version of Mc to Lc 7 do I find it this hard to set a custom property through the IDE tools (I went and tested back to Mc 2.5). I didn't see any mention of a custom property set actually being *required* just to use a custom property in the guide, but I could have missed it.

Anyone else seeing this, or is this just something I'm not getting?
Image

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Current Custom Properties setup ? [Un-Solved]

Post by Klaus » Wed Mar 27, 2019 3:48 pm

Question of the day: What is the debugger complaining about?

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Current Custom Properties setup ? [Un-Solved]

Post by bogs » Wed Mar 27, 2019 4:19 pm

My bad, says there is no such object (custom property), when apparently there is (I see it when i go to the palette, and of course the MB says it works).
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”