dbnewbie
asked on
How to watch variables in VB6
I want to watch the changes of a variable in my program. I have done an Add Watch to the variable, but cannot see the ENTIRE contents of the variable. The variable is a string with hundreds of characters. How do I view everything? The watch window limits what I can see.
hmmm why don't you write it out into text box, just temporary write some code there. It's would take so much time I think.
I tend to use a msgbox command where I'm trying to see long strings. It has a limit too.. but displays alot more than the watch window.
ASKER
The msgbox approach is what I have been doing. Unfortunately, for what I am working on, it is very impractical. There must be a better way. Isn't there a way to make that watch window shot it all?
Are you really going to be able to watch hundreds of characters? You could print to a file if you just want to verify the variable contents when your program ran...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Press Ctrl+G to active "Immediate" window!
:-)
Add a "toggle breakpoint" in your form_load sub, and then run your program,
while it pause at the breakpoint, active the local windows by "View"-> "Local Windows".
Add a "toggle breakpoint" in your form_load sub, and then run your program,
while it pause at the breakpoint, active the local windows by "View"-> "Local Windows".
hi,
Have u trid
debug.print varname
This may give u the whole thing in the debug window...
Have u trid
debug.print varname
This may give u the whole thing in the debug window...
dbnewbie,
If you are conserned about the end of the string, and that is why you are trying to see the whole thing, use
strWatchThisString = Right$(strLongString, intCountOfImportantCharact ers)
You can use Mid if the important characters is in the middle of the large string
Dang123
If you are conserned about the end of the string, and that is why you are trying to see the whole thing, use
strWatchThisString = Right$(strLongString, intCountOfImportantCharact
You can use Mid if the important characters is in the middle of the large string
Dang123
>>I have done an Add Watch to the variable
IF you have do that, make sure set 'Break when value changes' on watch type.
If any changes, the problem will stop and do
?variablename
on immediate window
IF you have do that, make sure set 'Break when value changes' on watch type.
If any changes, the problem will stop and do
?variablename
on immediate window
>>the problem will stop and do
the program will stop and do
the program will stop and do
FYI
When you pointing on your var name with mouse and holding the CTRL down you will see the end of the string in ToolTips box
When you pointing on your var name with mouse and holding the CTRL down you will see the end of the string in ToolTips box