>>>Be that as it may, it's still possible that my approach would circumvent the problem. If an Error event is triggered at all, you shouldn't need to depend on a non-local RETURN TO ... in this situation. A normal return from the Error handler to the offending code would suffice. Then you can invoke the appropriate context-specific error handling logic in normal code, after the Error handler is off the stack. The only time I use RETURN TO ... is for special cases of unanticipated errors, or if the user deliberately requests an Abort.
>>
>>Well, I can't apply such logic whenever we will use a COUNT function. We also do not control other programmers. So, some of them may use a COUNT and forget to include such implementation. It need to be control at the upper level.
>
>Why not write your own function, mfcount(lfield,oper,rfield)
>which checks for all the problems and returns either 0 or the actual count,
>executing VFP's count only when it is safe to do so?
This means we have to cover all applications in production. It has to be controlled at the error handler level.