Solved

VS.NET Debugging: Variable watch

Posted on 2004-04-21
5
443 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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