Forgotten variables

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Dec 6 07:13:25 EST 2006


Hi Horst,

To declare globals (or local) variables you may use:

global gVar1
global gVar2
global gVar3
global gVar4

local tVar1
local tVar1
local tVar1
local tVar1

Declaring a variable per line.
Or:

global gVar1, gVar2, gVar3, gVar4

local tVar1, tVar2, tVar3, tVar4

Using a single line.

Please note:
When declaring multiple variables in a row, variables names appear  
always as a comma delimited list (space is up to you: it's not  
necessary)
Variables names are prefixed to immediately notice in the code their  
status.

Where to declare variables?

1. At the top of an object's script: locals will be script local  
variables, i.e. accessible by all handlers in the script and global  
will not need to be declared in any handler that use them in this  
script.
2. At the beginning of any handler: locals will be only accessible in  
this handler and globals will have to be declared in each handler  
that uses them.

Hope this helps.

Best Regards from Paris,
Eric Chatonet

Le 6 déc. 06 à 12:56, baleareninsel at gmx.net a écrit :

> Hello everybody,
>
> Using RunRev 2.7.4,
>
> I declare
>
> on preopenstack
> ...
> ...
> global var1 var2 var3 var4
> ...
> ...
> put "my variable" into var1
> end preopenstack
>
> Now, in another card, I would like to use var1, but var1 is empty.  
> Does someone know why? where is my fold?
>
> best regards and Thanks in advance
>
> Horst

------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list