Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VS.NET Debugging: Variable watch

Posted on 2004-04-21
5
Medium Priority
?
447 Views
Last Modified: 2012-06-27
I know in VisualAge for Java I used to be able to put a breakpoint on a variable...not at a particular point in the code, but in a debugging window, and the code would break as soon as that variable was changed, or became a certain value.. (useful for loops if you want to break a loop when it hits 100 iterations etc, or a boolean field validating to true).

yes.. I know I could just put a breakpoint on this line:   If var = true then var = true    or something like that..but you won't get any points for an answer like that.

Does anyone know? Even a work-around would be somewhat satisfactory.. (Ie i tried declaring the bool value 'WithEvents' but it wouldn't let me).

Thanks!
0
Comment
Question by:bswiftly
  • 2
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 120 total points
ID: 10878472
0
 
LVL 1

Author Comment

by:bswiftly
ID: 10878530
Thanks,

I remember trying this method before and it says that VB, or C# don't support variable breakpoints.

Does anyone have a work around or know how to declare a variable with events?
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 10878690
actually i've tested it right know and it works fine with c# :)
the only special think is that when you set a break point in a function you can set it on the first function's line

B..M
0
 
LVL 1

Author Comment

by:bswiftly
ID: 10878961
well I am in a VB environment, and i entered in C# (just to see if i'd get the error too.. cuz i'm always looking for a reason to change to C#).

Alright.. you got it to work on a function..thats great.  and easy.  

try this:
declare  a boolean value.  
modify it in a few different places in your code...
set up a breakpoint not on a particular line of code, or at the entry point of a particular method, but when the boolean variable changes its vlaue.

0
 
LVL 7

Assisted Solution

by:Z_Beeblebrox
Z_Beeblebrox earned 80 total points
ID: 10881396
Hi,

The VB.Net debugger is very powerful. If you add a breakpoint, you can right click on the brown ball, and select breakpoint properties. From there, you can set the break point to only fire when a certain condition is true (e.g. a loop counter is a certain value) or when the break point has been hit a certain number of times (also useful for a loop!). That should suffice to meet  at least some of your requirements. Unfortunately, it doesn't do the variable watch thing that VB6 does which is very useful.

Zaphod.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

971 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