The Interactive Geometry Software Cinderella

Forum: Cinderella Support (E)

Forums->Cinderella Support (E)->Scope of variables

dirkd
3 stars
Scope of variables


Sorry for all these posts, but I want to restrict each post to a single subject.

The rules for variable scopes in Cindyscript are not very clear to me. What happens if I assign different values to the same variable in different folders of the scripteditor? I expect an assignment to a in the folder \Draw overwrites an assignment made in \Initialization, but I'm not sure. Could somebody provide me with the precize rules?

Say I define a variable in \Move. Is its value accessible in other folders? What about two different scripts in the same folder using the same variables?

 
on: Wed 18 of Oct, 2006 [20:32 UTC] reads: 109315

Posted messages

author message
Aw: Scope of variables
on: Mon 23 of Oct, 2006 [10:14 UTC]
Dirk,

the variable is, once defined, valid in all other scripts, unless you define it locally only. The default is that it's available globally.

Ulli


author message
dirkd
3 stars
Re: Aw: Scope of variables
on: Mon 23 of Oct, 2006 [10:31 UTC]
Right, I just located the help page about scope of variables. Sorry.

> Dirk,
>
> the variable is, once defined, valid in all other scripts, unless you define it locally only. The default is that it's available globally.
>
> Ulli




Show posts:
 
Language