LONI Forums
  #1  
Old 11-04-2009, 10:26 AM
amg amg is offline
Junior Member
 
Join Date: Feb 2009
Posts: 7
Default Variable scope

I am starting to use nested modules and wanted to ask about the scope of variables inside. Are all variables global, or are their scope limited to the group that they are in?

Thanks,

Allan
Reply With Quote
  #2  
Old 11-04-2009, 10:33 AM
zliu zliu is offline
Member
 
Join Date: Feb 2009
Posts: 52
Default Re: Variable scope

Hi Allan,

Variable is not global. Variable defined in a module group is not visible outside this module group.

Thanks,
Zhizhong
Reply With Quote
  #3  
Old 11-04-2009, 10:33 AM
ppetrosy ppetrosy is offline
Junior Member
 
Join Date: Feb 2009
Posts: 23
Default Re: Variable scope

Hi Allan

Variables are designed to support inheritance so nested modules are able to access parent's variables. Parent cannot access variables which are declared in nested modules.

Petros.
Reply With Quote
Reply

Tags
groups, modules, scope, variables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 10:41 PM.