Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BindEvent() Why does it not work with the Error-event ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
BindEvent() Why does it not work with the Error-event ?
Miscellaneous
Thread ID:
00947460
Message ID:
00947460
Views:
68
*
* 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
Map
View

Click here to load this message in the networking platform