Solved

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

Posted on 2014-04-22
3
214 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now