Thanks Mark for the comment on globals. I just tested and see that once declared, the globals and their contents persist as long as the LC session is open, even if all other stacks are closed. I closed everything but LC, built a new stack from scratch with a global of the same name, and it had the previous contents.
Which leads to a question - is there a way to make a global of stack (or stack and substack) scope? Are user defined properties the only way?
Thanks, Walt
Globals Question (was Menu Popup)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Globals Question (was Menu Popup)
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Globals Question (was Menu Popup)
Hi Walt,
Custom properties are a really convenient way to make data available to all scripts without messing with globals. Additionally, you can define local variables instead of global variables. Local variables (declared outside a handler) are available to that particular script only.
Best,
Mark
Custom properties are a really convenient way to make data available to all scripts without messing with globals. Additionally, you can define local variables instead of global variables. Local variables (declared outside a handler) are available to that particular script only.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Globals Question (was Menu Popup)
Hi Emma!
Global variables are global throughout any stacks open in a session. I was asking if there was a way to make a variable global only to the stack - there's not, I am going to use custom properties instead. That way I can use the same name in scripts used in multiple stacks and they will not have shared contents.
Global variables are global throughout any stacks open in a session. I was asking if there was a way to make a variable global only to the stack - there's not, I am going to use custom properties instead. That way I can use the same name in scripts used in multiple stacks and they will not have shared contents.
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Globals Question (was Menu Popup)
Walt,
Since private messaging has been turned off, I have to do this in public. I have noticed that you replied to spammers several times now. Please understand that by replying to spam, you help the spammers. The more replies they get, the more attention they get for their porn, viagra pills, and casino sites.
Before you reply, please check whether you're replying to a spammer. How can you see this? Here are some possible clues:
- the post may contain a quote from elsewhere in the forum
- the spammer didn't write anything clever about LiveCode (e.g. "Hi, can it do this?")
- the spammer wrote about something that has nothing to do with LiveCode (e.g. shoes)
- there is a link in the signature or in the post
- the spammer has written less than 10 messages
- all messages were written on the same day
- your first impression of the post is "huh?!"
- sometimes you can find the user name here
Kind regards,
Mark
Since private messaging has been turned off, I have to do this in public. I have noticed that you replied to spammers several times now. Please understand that by replying to spam, you help the spammers. The more replies they get, the more attention they get for their porn, viagra pills, and casino sites.
Before you reply, please check whether you're replying to a spammer. How can you see this? Here are some possible clues:
- the post may contain a quote from elsewhere in the forum
- the spammer didn't write anything clever about LiveCode (e.g. "Hi, can it do this?")
- the spammer wrote about something that has nothing to do with LiveCode (e.g. shoes)
- there is a link in the signature or in the post
- the spammer has written less than 10 messages
- all messages were written on the same day
- your first impression of the post is "huh?!"
- sometimes you can find the user name here
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Globals Question (was Menu Popup)
Thanks, Mark, that occurred to me belatedly.
Walt Brown
Omnis traductor traditor
Omnis traductor traditor