Invoking error routine #2 from error routine #1

Invoking error routine #2 from error routine #1

Post by Steven Papie » Sun, 12 Jan 1997 04:00:00



I am running FPD 2.6.  From within my error routine I would like
to invoke a DIFFERENT error routine to trap errors that the first
routine generates.  It doesn't seem to work.

Any suggestions?
--
Steven Papier

http://www.wheatonmusic.com

 
 
 

Invoking error routine #2 from error routine #1

Post by Gene Wirchen » Mon, 13 Jan 1997 04:00:00



>I am running FPD 2.6.  From within my error routine I would like
>to invoke a DIFFERENT error routine to trap errors that the first
>routine generates.  It doesn't seem to work.
>Any suggestions?

     Without getting too much into the specifics of language:

          In initialization of system:
             global errorstatus
             errorstatus=0
             on error do errorhandler1

          procedure errorhandler1
             errorstatus=errorstatus+1
             if errorstatus>0
                do errorhandler2 with appropriate context data
             else
                main part of errorhandler1
             errorstatus=errorstatus-1
             return as appropriate

          procedure errorhandler2
             handle the errorhandler1 error
             return

     Take care that errorstatus is incremented and decremented
correctly.

Sincerely,

Gene Wirchenko

C Pronunciation Guide:
     y=x++;     "wye equals ex plus plus semicolon"
     x=x++;     "ex equals ex doublecross semicolon"

 
 
 

1. Error trapping within my ON ERROR routine

I've got a single global error-handling routine. However, I'd like to
include a command in it that might generate an error. Elsewhere, the
following works:

lcOldOnError=ON("ERROR")
ON ERROR *  && Do nothing
loWord.Visible=.T.      && This will fail if loWord doesn't exist or
the link to MSWord is no longer current
ON ERROR &lcOldOnError

However, within my main ON ERROR routine, the command generates a
standard VFP error.

How can I get round this?

--
Ben Hambidge

2. Problem on adding records to a table on an IOMEGA-Zip-Drive with PDOX DOS 3.5

3. VFP 3.0 Error routine, i need to control project errors (microdigital@telepac.pt)

4. Upgrade of SQL7 to SQL2000 - Need setup.ins file

5. Problems Using Error Event and On Error routines

6. Upgrade to SQL*Server 6.5 Error: Help?

7. Invoking OS command or a C routine from Stored Procedure

8. Invisible diagram

9. PerfmonLoad routine returned error code 6

10. PerfmonLoad routine returned error code 267

11. How do I write a generic routine for error trapping

12. Error Handling Routines