I would like to trigger a method of an object by using BINDEVENT()
, but the method may not exist. Thus, I want to check if the method is defined before issuing BINDEVENT()
.
For example, in the following code snippet, if oHandler.myresize()
does not exist, the error will be triggered at the line of BINDEVENT()
.
PUBLIC oHandler
oHandler=NEWOBJECT("myhandler")
DO (_browser)
BINDEVENT(_SCREEN,"Resize",oHandler,"myresize")
DEFINE CLASS myhandler AS Session
PROCEDURE myresize
IF ISNULL(_obrowser) THEN
UNBINDEVENTS(THIS)
ELSE
_obrowser.left = _SCREEN.Width - _obrowser.width
ENDIF
RETURN
ENDDEFINE
Thus, I want to check the method myresize()
exists or not.
Is there any language function for this purpose? It is very similar to a php function function_exits() or method_exists().
PEMSTATUS( VariableNameRepresentingTheObject, "MethodOrPropertyLookingFor", 5 )
returns true or false if exists on the given object.