Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BindEvent() Why does it not work with the Error-event ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
BindEvent() Why does it not work with the Error-event ?
Divers
Thread ID:
00947460
Message ID:
00947460
Vues:
67
*
* 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
Fil
Voir

Click here to load this message in the networking platform