?
Solved

TRAPPING A VARIABLE IN ALL SUBS IN ONE CALL

Posted on 2005-03-06
4
Medium Priority
?
277 Views
Last Modified: 2010-05-18
My program contains many subs,
I do trapping during record handling on sub-level like:

Status% = vBookList.Update
If Status% Then
 Dum$ = "In update name," & vbCr & "in phonelist " &  vbCr & "system did not update"
  MsgBox msg, vbCritical, "Update errornr: " & Str$(Status%)
  exit sub
 End If

Now I write this in all databased subs,
Would there be a way to put in a sub or function, or on form-level something like:
"display the call and go back or to form or whatever is needed."
because in data sub will only be:
 if status% then
   call (the_thing_doing_this, err, status%,"Phonebook")
end if



 
0
Comment
Question by:BIAPRO
  • 3
4 Comments
 

Author Comment

by:BIAPRO
ID: 13470356
extra info, this is in VB6
0
 
LVL 15

Accepted Solution

by:
Ralf Klatt earned 2000 total points
ID: 13470442
Hi,

I'd suggest reading the following article: http://www.andreavb.com/tip010004.html

It is a very good and easy to understand sample about "Error Handler" (standardized error processing across an application) ...

The procedures provide a methodology for the processing of errors in an application. As you build a subroutine simply include the error handling structure provided and all of your errors are handled in a standard way.  The subroutine 'on error' code section invokes the subroutine "sub ErrorHandler()"; it in turn calls "sub MsgLogHandler()" to post various messages in a log file. All source code required for this methodology is included in that write-up!


Best regards,
Raisor
0
 

Author Comment

by:BIAPRO
ID: 13470480
I got the info, its a lot will work on it today, let you know, thanks sofar
Regards,
Jack Biapro
0
 

Author Comment

by:BIAPRO
ID: 13470574
Like my my other question , see the light!
Thanks ,
Jack
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question