VB 6.0 Watch window – how to view lengthy string values?
Use the Immediate Window instead.
We are in the beginning or re-writing some VB 6.0 code to the .Net framework. Absolute zero business logic known to anybody but the application itself. All we have to do is to trace the VB code line by line, skim the business logic and validation, the program flow out of it, and then come up with a design for the new .Net equivalent.
We will be sitting with the Microsoft Visual Basic 6.0 IDE’s for some part of the day every day, trying to create a test environment with mock data so we could run the VB 6 executable’s code to completion. While we are at it, we will be watching for local variables’ values. Watch window proved to be really helpful, coming from a .Net background, however, when there is a string that is larger than the size of the Watch window itself, and when you try to copy the value out of that variable from the watch window, you’d be seriously disappointed. No matter what you try, all your efforts to copy the entire string value from the watch window will be futile! [Fig 1]
Immediate Window struck me suddenly, that’s it! [Fig 2] type in print variableName and your lives would be spared 😉
[Fig 1] – VB 6 Watch Window
[Fig 2] – VB 6 Immediate Window
In the new era, Visual Studio, we have so many options. The Locals Window, the Autos Window, the Watch Window (up to 4 numbers), the Immediate Window, the debugger tool tip [Fig 3].
[Fig 3] – Visual Studio 2010 Debugger tool tip