You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code, when undeclared is on, the references to method myhandler() and the function myhandler_func() used for subscribing to the event are seen as undeclared memvars, resulting to runtime errors about them not being defined.
Not sure if this can be distinguished by the compiler.
#pragma options (memvar,on)
#pragma options (undeclared,on)
#pragma options (fox2,off)
//#pragma options (fox2,on) // does not make a difference
CLASS TestClass
EVENT myEvent AS EventHandler
CONSTRUCTOR()
SELF:myEvent += EventHandler{ SELF , @myhandler() } // works OK
SELF:myEvent += SELF:myhandler // works OK
SELF:myEvent += myhandler // warning XS9073: Variable 'myhandler' has not been declared. Assuming this is a FIELD or a MEMVAR.
SELF:myEvent += EventHandler{ NULL , @myhandler_func() } // warning XS9073: Variable 'myhandler_func' has not been declared. Assuming this is a FIELD or a MEMVAR.
SELF:myEvent += myhandler_func // warning XS9073: Variable 'myhandler_func' has not been declared. Assuming this is a FIELD or a MEMVAR.
SELF:myEvent(NULL,NULL)
RETURN
METHOD myhandler(sender AS OBJECT , e AS EventArgs) AS VOID
? "invoked"
END CLASS
FUNCTION myhandler_func(sender AS OBJECT , e AS EventArgs) AS VOID
? "invoked"
FUNCTION Start( ) AS VOID
TestClass{}
RETURN
The text was updated successfully, but these errors were encountered:
In the following code, when undeclared is on, the references to method myhandler() and the function myhandler_func() used for subscribing to the event are seen as undeclared memvars, resulting to runtime errors about them not being defined.
Not sure if this can be distinguished by the compiler.
The text was updated successfully, but these errors were encountered: