Solved

VS.NET Debugging: Variable watch

Posted on 2004-04-21
5
444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 30 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 20 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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