Hi

Something I've never been able to do in 8 years of Active4D is reproduce the 
following behaviour documented in the "global" command description (Page 223):

>>  If this command is used within a method and localVar does not exist in the 
>> global scope, if it is defined within the method it will be in the global 
>> scope  <<

My understanding of this is that I should be able to define a global like this:

******************** LIBRARY METHOD **********************

method "foobar"

        global($bar)
        $bar:="HELLO"

end method

****************************************************************

 . . . and then access it like this:

******************** REGULAR PAGE SCRIPT (FAILS) ********

foobar
write($bar)

************************************************************************

But I can't - Active4D always errors and I have to pull it into scope in the 
calling script like this:

******************** REGULAR PAGE SCRIPT (WORKS) ********

foobar
global($bar)
write($bar)

************************************************************************

(i.e. I always need the global command BOTH in the defining method and in the 
calling one as well).
Have I mis-understood the behaviour of the global command ?

Regards

Peter

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to