Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form's Error

Status
Not open for further replies.

FranklinYeung

Programmer
Apr 20, 2001
31
0
0
HK
Hi all,

I am developing an error routine procedure, except on the main program to execute
ON ERROR Do sys(5)+curdir()+program\myerr.prg with error(), message(), message(1), program(), lineno(), date()

I am now considering another method such that any error hit in the form's controls (text box, combo box, grid, etc..)
will fire the form's error routine first,
but what should i code on the form's init function?

Can I write the following statement in the Form's init function in order to capture all form's contorls' error
ON Error Do this.error with error(), program(), lineno()

Or i need to code every controls' error rounte in the following way?

Command1.error()
LPARAMETERS nError, cMethod, nLine
this.parent.error(nError, cMethod, nLine)

TextBox1.error()
LPARAMETERS nError, cMethod, nLine
this.parent.error(nError, cMethod, nLine)

Any better solution so that the form's error route would fired first?

Many thanks

Franklin
:)
 
FranklinYeung

FoxPro error is hiearchy of class and not hiearchy of container. This means that you would have to place code in each control error event to call the form error control.

in each control ErrorEvent place code ThisForm.Error()

Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top