Link to home
Start Free TrialLog in
Avatar of dbnewbie
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.
Avatar of boringnaa
boringnaa

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.
Avatar of dbnewbie

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
Avatar of ROTRTechTeam
ROTRTechTeam

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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".
hi,

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, intCountOfImportantCharacters)

    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
>>the problem 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