Variable Scope
- Posted by Rich Klender <rklender at excite.com> Feb 02, 2007
- 609 views
Hey everybody, surprise!!! Another question!! I read over the part of the manual about variable scope and just want to bounce this off everybody to make sure I'm comprehending it correctly. Let's say I have the following: function somefunc(integer C) integer a,b,c a=1 b=2 c=3 return c end function Ok, now in my main program, because c was returned, I'll be able to "see" that c=3. However, because a and b are "local" to the function, I cannot, for instance, in my main program do: a=a+1 and expect to get a=2 as a result. I think I already know this cause Euphoria already told me that a is not defined. However, if I do this: function somefunc(integer C) global integer a,b,c a=1 b=2 c=3 return c end function When I return from to my main program, I should be able to "see" that a=1, b=2, etc. even though those variables weren't returned? Thanks for the patience!! Rich