By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,061 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,061 IT Pros & Developers. It's quick & easy.

Real-time Watch/Trace

P: n/a
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?

--
Thanks,
Ricky W. Hunt
freendeed
Nov 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
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

"Ricky W. Hunt" <rh*****@hotmail.com> wrote in message
news:8VjPc.76130$eM2.57946@attbi_s51...
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?

--
Thanks,
Ricky W. Hunt
freendeed

Nov 20 '05 #2

P: n/a
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:OS*************@tk2msftngp13.phx.gbl...
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?
Nov 20 '05 #3

P: n/a
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
"Ricky W. Hunt" <rh*****@hotmail.com> wrote in message
news:uxmPc.233039$Oq2.151171@attbi_s52...
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:OS*************@tk2msftngp13.phx.gbl...
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?

Nov 20 '05 #4

P: n/a
Everyplace u want

"Ricky W. Hunt" <rh*****@hotmail.com> wrote in message
news:uxmPc.233039$Oq2.151171@attbi_s52...
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:OS*************@tk2msftngp13.phx.gbl...
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?

Nov 20 '05 #5

P: n/a
"Charles Law" <bl***@nowhere.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
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?
Nov 20 '05 #6

P: n/a
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
"Ricky W. Hunt" <rh*****@hotmail.com> wrote in message
news:8SqPc.216003$JR4.86577@attbi_s54...
"Charles Law" <bl***@nowhere.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
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?

Nov 20 '05 #7

P: n/a
"Charles Law" <bl***@nowhere.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...

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.
Nov 20 '05 #8

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #9

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #10

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #11

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #12

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #13

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #14

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #15

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #16

P: n/a
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_2...WatchTrace.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 1 '07 #17

This discussion thread is closed

Replies have been disabled for this discussion.