Cant use custom properties

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Cant use custom properties

Post by dunbarx » Thu Mar 29, 2018 10:12 pm

Aw, and they are my favorite.

I have a handler that collects three custom properties from a button, navigates to another stack, and updates those values into identical properties in another button. Works fine.

I tried to add a fourth property to the original button, but that property will not update the property in the "target" button. It just won't. I tried a fifth, same issue. I changed the names of the two new properties, same issue.

Did I mention the original three work just fine? I am well aware that these sorts of things are invariably operator malfunction. But this one has me stumped. I am seriously thinking of setting a global variable instead. But that is soooo 80's.

Is it possible there is some sort of corruption?

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Cant use custom properties

Post by FourthWorld » Thu Mar 29, 2018 10:27 pm

Without seeing an example stack to examine what's happening it's difficult to say.

But with the card changing going on, it may be that "the target" is changing firing the sequence. Or if a "send" is used the target will definitely change.

To avoid possible ambiguity, if I need a reference to an object I know I'll be referring to later on I usually start by putting its long ID into a var and issuing that throughout.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Cant use custom properties

Post by dunbarx » Thu Mar 29, 2018 11:47 pm

Richard.

OK.

I now am watching the property inspector as I change the property in the destination button from msg.

If I set a value of one of the "old" properties, the key stays the same, and the value changes. As expected.

But if I try to set a value to the new property, intending to both create it on the fly and set it, a new EMPTY key is created instead, set to that new value. Thereafter, if I change its value, the change sticks, associated with that empty key.

And it appears that only a particular property name shows this effect. If I set the "XYZ" to "ABC", or whatever, all is good. As expected.

It is the particular string "univEC" that is causing the problem. That is a nice descriptor for what I had in mind, and I can change it easily. But it is not reserved in LC, I believe, so what gives? I have no idea if this is reproducible by others.

I actually did substitute a global for the property in my project, and all works fine. As expected. So I will go back and use a different property name. I assume that will work as well.

So what gives?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Cant use custom properties

Post by jacque » Fri Mar 30, 2018 7:55 pm

In a new stack, from the message box, I can set the univEC of a button to a value and it works. Do a search for that string and see if it is being used somewhere else for something, maybe there's a conflict.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Cant use custom properties

Post by FourthWorld » Fri Mar 30, 2018 9:55 pm

My test here is the same as Jacque's, with good result. Do you have a setProp handler for univEC somewhere?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Cant use custom properties

Post by dunbarx » Fri Mar 30, 2018 9:57 pm

Jacque.

Thought of that. Nada.

But even if that string was used in variables here and there, global, local or on-the-fly, how could that affect the getting and setting of a custom property between two consenting buttons?

Anyway, changing the string from "univEC" to "uniEC" simply made the problem go away. I changed nothing but the property name, and consider the issue a mystery. And by mystery, I mean it must be something I did or have.

I don't really believe that.

Thanks for taking the time to test.

Craig

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

Re: Cant use custom properties

Post by dunbarx » Fri Mar 30, 2018 9:58 pm

Richard.

I rarely use setProp or its cousin. I do not have any of those contractions in this project.

Thanks for testing. It must be me. I will really dig into the code of every little corner on monday. I think I did, though, searching the entire stack file.

Craig

Post Reply

Return to “Talking LiveCode”