Solved

VS.NET Debugging: Variable watch

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

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…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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 …

685 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