Page 1 of 3

property contents

Posted: Fri Apr 17, 2020 3:59 pm
by wanglucas
Hello All

im following along with a live code tutorial online


the video instructs that i need to make a custom property and then fill its property contents with a number 1
cnav.jpg


the tutorial video is being done on mac os......while i have windows so i dont see the exact same layout for livecode and therefore I dont see the property contents section....please advise


cnav2.jpg

Re: property contents

Posted: Fri Apr 17, 2020 4:14 pm
by Klaus
Hi wanglucas,

that video has been made with an older version of LC!
The current version does look the same on each platform!

OK
1. Click "Add new element"
2. Enter you name of the custom property in the KEY field
3. Enter the VALUE for that CP in the VALUE field
That's it! :-)

Best

Klaus

Re: property contents

Posted: Fri Apr 17, 2020 4:41 pm
by richmond62
You can also do this sort of thing:

Code: Select all

set the myDaftProperty of button "Press" to "cookbook"

Re: property contents

Posted: Fri Apr 17, 2020 5:47 pm
by dunbarx
What everyone said.

Custom properties are one of the most endearing, er, properties of LC. You can create, populate, modify and delete them at will, all from either the property inspector, as Klaus taught, or daftly ad hoc, as Richmond offered.

They are available from every corner of LC, not just, for example, script local or global variables, which are only available within scripts. They survive sessions. They can be named descriptively. They can contain arrays, delimited text, whatever.

I like them.

Craig

Re: property contents

Posted: Fri Apr 17, 2020 7:49 pm
by bogs
dunbarx wrote:
Fri Apr 17, 2020 5:47 pm
They survive sessions.
You should probably clarify that one a bit, Craig. :)

Re: property contents

Posted: Fri Apr 17, 2020 7:57 pm
by Klaus
When you save a stack and quit, all variables are gone, CPs stay (survive)! :D

Re: property contents

Posted: Fri Apr 17, 2020 8:09 pm
by bogs
You sure you want to say it that way? :)

*Edit - after having re-read it, I have come to the conclusion that my reading skills can also use improvement :cry:

Re: property contents

Posted: Fri Apr 17, 2020 8:30 pm
by Klaus
Yes, but I'm not a native english speaker, so please forgive me if this is not correct.

Re: property contents

Posted: Fri Apr 17, 2020 8:48 pm
by bogs
Oh my.

Well, Hopefully I didn't confuse the heck out of poor wanglucas, as far as it went, what was said above was true in the context you brought up, i.e. if you statically set up a custom property through the inspector or through code in the ide, when you save that stack, the information you entered literally becomes part of that stack, and survives between sessions.

However, if you create a stack where you start creating custom properties through code dynamically, the only way that survives sessions is if you are using a launcher stack or are still in development in the IDE.

If the stack creating custom props dynamically through code is part of the executable, those custom properties will most definitely *not* survive between sessions.

My apologies to wanglucas for building suspense as it were, but as many times as we've seen that come up here, I can't imagine leaving it as stated above.

Re: property contents

Posted: Fri Apr 17, 2020 9:47 pm
by dunbarx
Bogs.

Launcher stack?

Surely no OS will allow an executable to be saved, nor any changes made to such a file during its "session"(such as any fooling around with a custom property). But that is an entirely different discussion.

A custom property, however it is made, becomes part and parcel of a stack, just as any field or button or any other change would. Once that stack is saved, it is saved as well. Forever.

If you restart your machine and reopen the stack from scratch, there it is. Just like that new button you made just before the last save.

So did you mean that no part of an executable, when making a standalone, would save a CP?

Craig

Re: property contents

Posted: Fri Apr 17, 2020 10:00 pm
by bogs
dunbarx wrote:
Fri Apr 17, 2020 9:47 pm
Launcher stack?
Oh I see, you wouldn't have ever lowered your standards enough to make one of those, would you? :twisted:
dunbarx wrote:
Fri Apr 17, 2020 9:47 pm
Surely no OS will allow an executable to be saved, nor any changes made to such a file during its "session"(such as any fooling around with a custom property). But that is an entirely different discussion.
When you say something like ....
dunbarx wrote:
Fri Apr 17, 2020 5:47 pm
Custom properties are one of the most endearing, er, properties of LC. You can create, populate, modify and delete them at will, all from either the property inspector, as Klaus taught, or daftly ad hoc, as Richmond offered.

They are available from every corner of LC, not just, for example, script local or global variables, which are only available within scripts. They survive sessions. They can be named descriptively. They can contain arrays, delimited text, whatever.
...without any clarification, then I think this is exactly the discussion you should be including :P

I suppose if you don't agree, I could always go through say, the last couple of years threads on the subject and link them here to refresh your memory, but I know you wouldn't want to force me to actually do some kind of work to belabor the point, especially knowing how lazy I am :P :P :P

Re: property contents

Posted: Fri Apr 17, 2020 11:31 pm
by dunbarx
Bogsie.

Um, do we agree on the facts? I am not sure, though I suspect we do.

I never, in my original fanboy post about the glories of CP's, mentioned or even considered standalone applications. That was not my point.

You did, though, and expanded the range of the discussion, ah, just a bit.

I still love you.

Craig

Re: property contents

Posted: Sat Apr 18, 2020 10:28 am
by bogs
I think we completely agree on the facts my friend, the only reason I posted was because I think you left a few of them out :P

I don't think the discussion was expanded in the least, btw, simply prefacing or exiting what you posted with the words "While in the IDE..." or "While in development..." would have sufficed to clarify it completely.

Hopefully, what ever newcomer hits this thread next won't come away with a mistaken impression that c.p.'s some how magically survive after the program is turned into an executable ( unless it is a launched stack ).

Re: property contents

Posted: Sat Apr 18, 2020 10:57 am
by Klaus
Hey Bogs,

I'm still waiting for an explanantion why my comment "When you save a stack and quit, all variables are gone, CPs stay!" might be funny or strange or whatever you answer "You sure you want to say it that way?" implied! 8)

Best

Klaus

Re: property contents

Posted: Sat Apr 18, 2020 11:01 am
by bogs
Poor reading on my part, Klaus :oops: See the edited post :D