Solved

How to watch variables in VB6

Posted on 2003-12-07
13
1,361 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:dbnewbie
13 Comments
 

Expert Comment

by:boringnaa
ID: 9893154
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.
0
 
LVL 6

Expert Comment

by:Plamodo
ID: 9893571
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.
0
 

Author Comment

by:dbnewbie
ID: 9893613
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?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 8

Expert Comment

by:ampapa
ID: 9893674
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...
0
 

Accepted Solution

by:
ROTRTechTeam earned 25 total points
ID: 9894092
If you are expecting a certain value and are not certain whether you are getting it or not, do a debug.assert on the variable and your program will break on that line when the expression is true.
0
 

Expert Comment

by:lonsoft
ID: 9894413
Press Ctrl+G to active "Immediate" window!
0
 

Expert Comment

by:lonsoft
ID: 9894442
:-)

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".
0
 
LVL 2

Expert Comment

by:rekhasri
ID: 9895375
hi,

Have u trid

debug.print varname


This may give u the whole thing in the debug window...
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9895819
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

0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9896030
>>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
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9896035
>>the problem will stop and do

the program will stop and do
0
 
LVL 13

Expert Comment

by:Michael_D
ID: 9897875
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
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

773 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