#73006 - 2003-02-10 10:26 AM
Re: Passing Var by Reference (sorta)
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Glenn, Howard is making the point that the "$Seuss" variable is global - this is the default scope for variables unless you "Dim" them.
If you "Dim" your $Seuss variable so that it is only visible in the local scope you will find that your function no longer works. This is also a problem for files included with "CALL".
That doesn't mean that using Execute() to evaluate variable names isn't any less useful, sometimes it is the only way to construct a UDF (see the example push/pop functions here)
You just need to be aware that the variables must have a global scope to manipulate them this way.
Until we have static variables and pass-by-reference we won't be able to create truly discreet functions. [ 10. February 2003, 10:29: Message edited by: Richard H. ]
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|