About variable.

Kevin J kj2005.28 at gmail.com
Thu Mar 31 00:27:30 EST 2005


Thanks for the tip.

I was just fooling around with the socket functions, the problem that
I am having is the only way I can think of sending text from the open
socket is to put it in to a variable and put the contents of the
variable in to txtScreen field. Only problem with that is the the
variable does not empty and it eats up my system resources. Is there a
way to send the content from the socket to the field with out the
variable?

Thanks
Kevin


On Wed, 30 Mar 2005 21:07:57 -0800, Dan Shafer <revdan at danshafer.com> wrote:
> Just precede its name with the word "global":
> 
> global gMyVariable, gMyOtherVariable
> 
> (The "g" before the name is not required, but it is considered an
> optional "best practice" because it makes it easier to remember which
> variables are global when you use them in your programs.)
> 
> You can put this declaration in a script completely outside any
> handlers and make it a script global:
> 
> global gMyVariable, gMyOtherVariable
> 
> on mouseUp
>    -- do something
>    put "some stuff" into gMyVariable
> end mouseUp
> 
> on someHandler
>    -- do something
>    put "some other stuff" after gMyVariable
> end someHandler
> 
> Or you can define the global(s) inside all of the handlers where you
> want to use them:
> 
> on mouseUp
>    global gMyVariable, gMyOtherVariable
>    -- do something
>    put "some stuff" into gMyVariable
>    put "some other stuff" into gMyOtherVariable
> end mouseUp
> 
> on someHandler
>    global gMyVariable, gMyOtherVariable
>    -- do something
>    put "more stuff" into item 2 of gMyVariable
>    put ", still more stuff" after gMyOtherVariable
> end someHandler
> 
> 
> On Mar 30, 2005, at 8:52 PM, Kevin J wrote:
> 
> > How do you make a variable global so that you can use it though out
> > the program?
> >
> > Thanks
> > Kevin
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
> >
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dan Shafer, Co-Chair
> RevConWest '05
> June 17-18, 2005, Monterey, California
> http://www.altuit.com/webs/altuit/RevConWest
> 
>


More information about the use-livecode mailing list