Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 01:00 AM
WindAndWaves
Guest
 
Posts: n/a
Default debugging classes

Hi Gurus

I noticed that when you have a class module without error handling, you can
not actually debug it. That is to say, you will get an error when calling
the class, but it does not tell you where the error takes place. This is
especially difficult if you have several stacks within the class itself.

Here is what I do

1. create new instance of class
2. "let" some values in class
3. call a procedure in the class (open report)
4. this public sub, open report, calls several functions in the class itself
(private functions).

I get an error at 3, but I can not work out exactly where at 4 the error
occurs. Is there a way to work this out?


  #2  
Old November 13th, 2005, 01:00 AM
Steve Jorgensen
Guest
 
Posts: n/a
Default Re: debugging classes

When debugging, in the VB Editor, go to Tools -> Options, and somewhere in
there, you'll find 3 error handling options. The default option is to break
on unhandled errors, but there are 2 other options, Break in Class Module, and
Break on All Errors. If you select either of those other 2 options, the code
will stop on the line that has your error and ignore the active error handling
in the calling code. Remember to set that back to the default later.


On Mon, 21 Jun 2004 17:44:12 +1200, "WindAndWaves" <access@ngaru.com> wrote:
[color=blue]
>Hi Gurus
>
>I noticed that when you have a class module without error handling, you can
>not actually debug it. That is to say, you will get an error when calling
>the class, but it does not tell you where the error takes place. This is
>especially difficult if you have several stacks within the class itself.
>
>Here is what I do
>
>1. create new instance of class
>2. "let" some values in class
>3. call a procedure in the class (open report)
>4. this public sub, open report, calls several functions in the class itself
>(private functions).
>
>I get an error at 3, but I can not work out exactly where at 4 the error
>occurs. Is there a way to work this out?
>[/color]

  #3  
Old November 13th, 2005, 01:00 AM
Trevor Best
Guest
 
Posts: n/a
Default Re: debugging classes

WindAndWaves wrote:
[color=blue]
> Hi Gurus
>
> I noticed that when you have a class module without error handling, you can
> not actually debug it. That is to say, you will get an error when calling
> the class, but it does not tell you where the error takes place. This is
> especially difficult if you have several stacks within the class itself.
>
> Here is what I do
>
> 1. create new instance of class
> 2. "let" some values in class
> 3. call a procedure in the class (open report)
> 4. this public sub, open report, calls several functions in the class itself
> (private functions).
>
> I get an error at 3, but I can not work out exactly where at 4 the error
> occurs. Is there a way to work this out?
>
>[/color]
A Guess (since I use error trapping, never ran into this problem)
From code window, Tools->Options->General->Break in Class Module.

But you should error trap the code anyway.

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
  #4  
Old November 13th, 2005, 01:17 AM
Terry Kreft
Guest
 
Posts: n/a
Default Re: debugging classes


You can change the options for error handling to Break in Class module but
you should be error trapping in the class module anyway. If you want the
error to propagate to the calling code then you should do this explicitly
using err.raise.


--
Terry Kreft
MVP Microsoft Access


"WindAndWaves" <access@ngaru.com> wrote in message
news:KBuBc.2115$LT3.79969@news.xtra.co.nz...[color=blue]
> Hi Gurus
>
> I noticed that when you have a class module without error handling, you[/color]
can[color=blue]
> not actually debug it. That is to say, you will get an error when calling
> the class, but it does not tell you where the error takes place. This is
> especially difficult if you have several stacks within the class itself.
>
> Here is what I do
>
> 1. create new instance of class
> 2. "let" some values in class
> 3. call a procedure in the class (open report)
> 4. this public sub, open report, calls several functions in the class[/color]
itself[color=blue]
> (private functions).
>
> I get an error at 3, but I can not work out exactly where at 4 the error
> occurs. Is there a way to work this out?
>
>[/color]


  #5  
Old November 13th, 2005, 01:17 AM
WindAndWaves
Guest
 
Posts: n/a
Default Re: debugging classes

thank you all!


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles