Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement