Re: global variable change in substack not available to main stack

2011-07-12 Thread Pete
Yes it is - which makes available until you log out. Still have to be careful what you use it for between stacks of course but at least you don't have to declare it everywhere it's referenced. Pete Molly's Revenge On Tue, Jul 12, 2011 at 10:40 AM, Bob Sneidar wr

Re: global variable change in substack not available to main stack

2011-07-12 Thread Klaus on-rev
Hi Bob, Am 12.07.2011 um 19:37 schrieb Bob Sneidar: > There is another place in the message box where you can execute multiple > commands. > I think you can also execute multiple commands by separating them with a > semicolon, > but I might be wrong about that. you ain't :-) > Bob Best Kla

Re: global variable change in substack not available to main stack

2011-07-12 Thread Bob Sneidar
Isn't that a system variable? Bob On Jul 10, 2011, at 1:34 PM, Pete wrote: > Here's another twist on this. The Message Box has the ability to create > "global variables" - click the 4th icon from the left in the toolbar at the > top left of the message bar. > > If you define a global variable

Re: global variable change in substack not available to main stack

2011-07-12 Thread Bob Sneidar
There is another place in the message box where you can execute multiple commands. I think you can also execute multiple commands by separating them with a semicolon, but I might be wrong about that. Bob On Jul 10, 2011, at 7:29 AM, Slava Paperno wrote: > I'm curious about globals and the me

Re: global variable change in substack not available to main stack

2011-07-10 Thread Pete
Thanks for the info. Pete Molly's Revenge On Sun, Jul 10, 2011 at 9:25 PM, J. Landman Gay wrote: > On 7/10/11 3:34 PM, Pete wrote: > > If you want a variable that is truly global without having to declare it >> everywhere, this seems to offer that option. You'd

Re: global variable change in substack not available to main stack

2011-07-10 Thread J. Landman Gay
On 7/10/11 3:34 PM, Pete wrote: If you want a variable that is truly global without having to declare it everywhere, this seems to offer that option. You'd have to find a way to create such variables by script rather than through the message box though - maybe they are created as OS environment

Re: global variable change in substack not available to main stack

2011-07-10 Thread Pete
Here's another twist on this. The Message Box has the ability to create "global variables" - click the 4th icon from the left in the toolbar at the top left of the message bar. If you define a global variable with a name that starts with a $ sign, it seems to be available from any script without

Re: global variable change in substack not available to main stack

2011-07-10 Thread sl...@lexiconbridge.com
Interesting. Thanks, Jacque. Mark, yes I see your point. You are right. S. Sent from my mobile so please excuse brevity and typos. - Reply message - From: "J. Landman Gay" To: "How to use LiveCode" Subject: global variable change in substack not available to main

Re: global variable change in substack not available to main stack

2011-07-10 Thread J. Landman Gay
On 7/10/11 9:29 AM, Slava Paperno wrote: I'm curious about globals and the message box. I've been doing both (omitting the global declaration and including it) and I haven't seen any difference, but I've seen conflicting opinions in the posts here as well as some forums. What's the skinny on this

Re: global variable change in substack not available to main stack

2011-07-10 Thread Mark Wieder
Slava- Sunday, July 10, 2011, 7:46:21 AM, you wrote: > handler was forwarding the openCard message which in turn reinitialized the > globals, and thus the new value got lost. My only excuse is that it was 3 AM > on a Sunday. And this is exactly why I think the use of global variables is a Bad Id

RE: global variable change in substack not available to main stack

2011-07-10 Thread Slava Paperno
code- > boun...@lists.runrev.com] On Behalf Of Ian McKnight > Sent: Sunday, July 10, 2011 4:03 AM > To: How to use LiveCode > Subject: Re: global variable change in substack not available to main stack > > Hi Slava > > I understand what you mean about portability - I&

RE: global variable change in substack not available to main stack

2011-07-10 Thread Slava Paperno
I'm curious about globals and the message box. I've been doing both (omitting the global declaration and including it) and I haven't seen any difference, but I've seen conflicting opinions in the posts here as well as some forums. What's the skinny on this? Slava > > In the Message box: > > > pu

Re: global variable change in substack not available to main stack

2011-07-10 Thread Ian McKnight
; > boun...@lists.runrev.com] On Behalf Of Ian McKnight > > Sent: Sunday, July 10, 2011 2:23 AM > > To: How to use LiveCode > > Subject: Re: global variable change in substack not available to main > > stack > > > > Hi > > > > I just recreated you scri

Re: global variable change in substack not available to main stack

2011-07-10 Thread Mark Wieder
Slava- Saturday, July 9, 2011, 11:02:16 PM, you wrote: > In the Message box: > put gBgColor > --0, 0, 0 You have to declare the global variable. In the message box try global gBgColor; put gBgColor -- -Mark Wieder mwie...@ahsoftware.net ___ use-

RE: global variable change in substack not available to main stack

2011-07-10 Thread Slava Paperno
July 10, 2011 2:23 AM > To: How to use LiveCode > Subject: Re: global variable change in substack not available to main > stack > > Hi > > I just recreated you scripts in a stack. > > Stephen Barncard is correct the more usual place to put the global > statement &g

Re: global variable change in substack not available to main stack

2011-07-09 Thread Ian McKnight
Hi I just recreated you scripts in a stack. Stephen Barncard is correct the more usual place to put the global statement is outside the handlers at the top of the script. However. Your original card script is incomplete since the 'put' statement needs to be put into a handler. eg global gBgColo

Re: global variable change in substack not available to main stack

2011-07-09 Thread stephen barncard
Slava, sorry to be so abrupt. There are three main categories of variables. global - must be declared in every script that wants to "subscribe" to it, outside of handlers script local - declared and used only in the script it's contained by, outside of handlers handler local - declared and used o

Re: global variable change in substack not available to main stack

2011-07-09 Thread stephen barncard
Why are you putting the global for the substack inside a handler? globals don't live there. It should be OUTSIDE the handlers in the substack script. On 9 July 2011 23:02, Slava Paperno wrote: > In openCard script of the main stack: > > global gBgColor > put 0, 0, 0 into gBgColor > > > In a but

global variable change in substack not available to main stack

2011-07-09 Thread Slava Paperno
In openCard script of the main stack: global gBgColor put 0, 0, 0 into gBgColor In a button script in a substack: on mouseUp global gBgColor answer color with gBgColor --white is selected put it into gBgColor put gBgColor & cr after msg --255, 255, 255