Real-time Watch/Trace

  • Thread starter Thread starter Ricky W. Hunt
  • Start date Start date
R

Ricky W. Hunt

Is there a way to watch a variables value in real-time without running in
break mode? It seems you should just be able to give VB a list of
variables/objects that you could see at any time without having to step
through the program. I guess you could write spawn a second, non-MDI form
and figure out some way to send updated values to it every time a certain
value changes. But that would be heck of a lot of work. Does VB have any
function like this?
 
U can use debug.writeline/trace statements to dump the variables to the
output window or a log

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
 
One Handed Man ( OHM - Terry Burns ) said:
U can use debug.writeline/trace statements to dump the variables to the
output window or a log

Is that a line you put at the beginning of the program and it writes a line
every time the value changes? Or do you have to put it every place you want
the value displayed? I want something that say shows a variable and it's
value and just shows it's current value. For instance, if it was a variable
it would like watching the seconds on a digital alarm clock. Is there
nothing like this in VB.NET?
 
Everyplace u want



Ricky W. Hunt said:
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message

Is that a line you put at the beginning of the program and it writes a line
every time the value changes? Or do you have to put it every place you want
the value displayed? I want something that say shows a variable and it's
value and just shows it's current value. For instance, if it was a variable
it would like watching the seconds on a digital alarm clock. Is there
nothing like this in VB.NET?
 
Hi Ricky

If you control access to your variable through a property, you would be able
to add a single Trace statement to the property Set method to write out your
variable when it changes. You could even leave the Trace statement in your
production build, and anytime you wanted to see the value change just attach
the debugger to a running instance of your application.

HTH

Charles
 
Charles Law said:
Hi Ricky

If you control access to your variable through a property, you would be able
to add a single Trace statement to the property Set method to write out your
variable when it changes. You could even leave the Trace statement in your
production build, and anytime you wanted to see the value change just attach
the debugger to a running instance of your application.

HTH

Man this sounds like a lot of trouble to go to. Why in the world can't we
see the Watch window without being in break mode?
 
It depends on how you app is designed. If it is not designed using accessor
methods (properties) then adding them will be more painful. Ordinarily, any
public member variables should use properties to control access to them.
That leaves you with private member variables and variables with local
scope. If they have local scope then you already know when they will change
their value, i.e when the method is called that declares them.

So, are these global variables you are trying to observe?

Incidentally, I am not suggesting that the only way to trace these variables
is by attaching an external debugger. The Trace statements will execute and
display the value in the Output window in the IDE.

But to answer the actual question, I suspect that showing the Watch window
when not in break mode would add a tremendous computational overhead to the
application that would slow it down.

Charles
 
Charles Law said:
But to answer the actual question, I suspect that showing the Watch window
when not in break mode would add a tremendous computational overhead to the
application that would slow it down.

Of course you would have to use common sense and there would be a limit. I
don't know alot about how the low level stuff works but it seems like it
shouldn't be too hard for the debug IDE just to keep a watch on certain
variables and update the display when they change.
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Ricky: You are right on. In VB6 it is possible to watch variables in real time. Microsoft and the other people who responded to your post do not understand that Microsoft has made debugging more difficult and time-consuming by neglecting to carry over this feature from VB6.

I have an early version of .Net, hopefully they rectified this kludge in the newer versions

From http://www.developmentnow.com/g/38_2004_8_0_0_243439/Real-time-WatchTrace.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Back
Top