Solved

How to break execution when a specified value or expresssion changes anywhere in code

Posted on 2006-11-26
9
666 Views
Last Modified: 2008-01-09
Hi,

All as I want to do is break when the value of Err.LastDLLError changes.

In VB6 I would just use a conditional watch with a global scope and I could see exactly the line that the change occurs but I don't see that ability in VB.net. Using conditional watches to see when a value changes was a great tool in VB6, I hope it's not something MS has taken away.

I do see that the breakpoints are very cool now but breakpoints are limited to the line they are on (as far as I know.)

I am using Visual Studio 2005.
0
Comment
Question by:RegProctor
  • 4
  • 3
  • 2
9 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 18014062
Hi RegProctor, you can do this in vb.net too !

right click your break point (the red sphere)... you will see that you have the ability to have conditional break points !
0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 200 total points
ID: 18014616
I don't know about VS 2005, but unfortunately VS 2003 doesn't support Watchpoints for Visual Basic.  It's definitely possible to add a Watchpoint just as in older versions of Visual Studio, it's just that they won't actually do anything for VB code.  (If you want to convert the whole program to C# you'll have no problem setting a watchpoint.  (-;  )

(Kinger247, you're thinking of ordinary conditional breakpoints, which are still tied to a specific line of code.  That's definitely still supported, but requires knowing where to set the breakpoint in the first place.)
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 18014649
Indeed I am, more coffee ... coffee...
0
 
LVL 10

Assisted Solution

by:Kinger247
Kinger247 earned 50 total points
ID: 18014656
No, you cannot do conditional watch's in 2005.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18018902
Why the C grade?  If you were after more information we'd rather you ask before closing the question.
0
 
LVL 1

Author Comment

by:RegProctor
ID: 18020287
I'm not sure what you mean by "Why the C upgrade?" For one thing I would not consider going to C an upgrade as I had learned a long time ago it's all about "the right tool for the job" and not that one tool is all that much better than another.

Having looked through the answers and looking rather closely myself as far as I can tell there is no way to do what I want. Two people have said so and I can't find a way so I have just accepted "you can't" as the answer and allocated the points accordingly.

Now, if you know more then these people then please do tell!!!  I'll be happy to change the closing to your answer if you know that you actually "can" set a conditional watch or that there is a way to duplicate the debugging functionality... I'll be very very happy to give you the points and talk with the moderator if necessary to change the point allocation to you.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18020498
No, I was asking why you gave my answer a GRADE of C (not "upgrade").  Grading something a C means you were looking for more information (in which case you should ask before closing the question to give the expert a chance to respond), but you hadn't asked for any clarification and it now sounds like you did get the answer you want, so the grade is confusing.
0
 
LVL 1

Author Comment

by:RegProctor
ID: 18020599
Ah, thanks for clarifying that.

No, I just didn't think it took much to say "no you can't do that anymore". I don't think there was a lack in expertise but I don't think the whole thing was all that deep of a question or answer either. If it's bad form to put in a C then I'll bump it up, no problem. I would have left the B's and A's though to coding problems and solutions instead of something as simple as this.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18020692
I see.  It's not a big deal to me, but for future reference the grade should always reflect whether the answer adequately addressed your question.  It's the POINTS that reflect how difficult / hard it is.  You're right that something like this is easier to answer than a question about code, but that's why you made it worth fewer points.

I'm pretty sure I would've been met with some harsh reactions from students if I'd ever said, "Sure, you answered the quiz question fine, but it was an easy question so I failed you anyway."  (-;


Like I said, not a big deal to me, but it's something to keep in mind.  EE's description of this is here: http://www.experts-exchange.com/help.jsp#hi73
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Getfiles in vb.net 28 44
Convert an ASPX page into PDF 7 27
Close tabpage of custom control 9 24
Access to class from any project within a solution. 6 14
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now