SHolst22


I learnt all of my programming in Java and used to use the command prompt/debug window extensively to print information out to. I could use this to check flow and determine when things were executed, the order and more information about the workings of the code.

In VB I have been using Msgbox along with the Str() command. This is rather intrusive to the operation of the system. It also makes it hard to determine the order.

I thought of dumping stuff to a text file but thought that is rather complex and not as useful as a command prompt.

Any suggestions would be great. If a text file is the best option an example would be great.





Re: Is there a better way to debug.

Cringing Dragon


As this is a VBA forum, I assume you mean VBA and not VB.net or VB.6, etc.

The MS Visual Basic Editor (available from almost any MS Office App) has some inbuilt debugging functionality... found in the Debug menu. The simplest of which is to use "step into" or "run to cursor" - while in this debug mode, you can hover your pointer over any variable or many functions and properties, and the current value of that will be displayed. The "immediate window" might also be of use, depending upon what you're trying to debug.







Re: Is there a better way to debug.

Andy Pope

The VBE also has functionality to allow you to Watch variables or conditions.

Another useful command is Debug.Assert