[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to watch variables in VB6

Posted on 2003-12-07
13
Medium Priority
?
1,372 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
12 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 100 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

873 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