General information
Category:
Coding, syntax & commands
Title:
BindEvent() Why does it not work with the Error-event ?
*
* below the sample-code from the VFP-helpfile for the BindEvent() method.
*
* the sample is extended with a error-handler wich should not be active
* if the code is executed in development-envoirement.
*
* why is this not working ?
*
* R.Lemstra@xso.nl
Public oHandler
oHandler=Newobject("myhandler")
Do (_Browser)
Bindevent(_Screen,"Resize",oHandler,"myresize")
* uncomment te line below to check if the 'ErrorHandler'
* is correctly assigned to the error-method
*
* oHandler.Error()
Define Class myhandler As Session
Procedure Init
* IF _VFP.StartMode # 0
Bindevent(This,"Error",This,"ErrorHandler")
* endif
Endproc
Procedure myresize
If Isnull(_obrowser) Then
Unbindevent(This)
Else
_obrowser.Left = _Screen.Width - _obrowser.Width
ENDIF
ERROR 12
Return
Endproc
* uncomment the lines below to check the behaviour
* if the error-method was assigned corretly
*
* Procedure Error
* Lparameters lxPara1, lxPara2, lxPara3
* Wait Window 'Error'
* Endproc
Procedure ErrorHandler
Lparameters lxPara1, lxPara2, lxPara3
Wait Window 'Error'
Endproc
Enddefine
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only