Solved

Can't get a break to work when a value changes?

Posted on 2014-04-22
3
216 Views
Last Modified: 2014-04-22
I'm trying to get my program to break when a certain variable changes it's value. I've always thought that the "Watch" will do this, however, I can't seem to get it to work. I tried setting up a watch and I KNOW that it hits this certain variable and when it changes value, the program doesn't break into the code-behind. Any ideas?

Thanks!
0
Comment
Question by:BlakeMcKenna
3 Comments
 
LVL 9

Assisted Solution

by:dustock
dustock earned 250 total points
ID: 40015107
A watch wont stop the program, you need to add breakpoints in by left clicking the on the far left of the code view.  Then when the program hits the break point it will stop and allow you to debug, and see the value of your watch as long is its active in the block of code you broke on.
0
 
LVL 20

Accepted Solution

by:
ElrondCT earned 250 total points
ID: 40015131
Unfortunately, VB won't do a break simply based on a variable changing at any point in the program. (Some other languages will do that.) You have to set a breakpoint at a specific location in the code, where you set a Condition (right-click on the breakpoint button to select) to see if the variable has changed from what it was the last time the debugger checked it. But it can sometimes be challenging to figure out exactly where a variable is getting changed if there are lots of possible procedures that could be called.
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 40015260
I know how to set breakpoints. I thought the code did that whenever a variable changed it's value if you setup a watch. I thought VB6 did this but I must have been setting breaks and didn't realize it.

Thanks!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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