?
Solved

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

Posted on 2014-04-22
3
Medium Priority
?
220 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
[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
3 Comments
 
LVL 9

Assisted Solution

by:dustock
dustock earned 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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