TRANSFORMATIONS settings: Debugger



Check the Debugger box if you wish to start a debugging session or if you wish to give your project tracing capabilities.



Procedure calls are monitored automatically. You may wish to include parameters values and monitor line execution as well, which is very useful to see what your program does exactly, but will result in much slower execution time.


Instances - Debug.Print's

Take a look at the Debugger overview for more info on these features.


Variable Spy

This is where you define the public variables to spy on. Please have a look at the Inline Help in the Control center to see how to declare variables to spy on.

Please note that this feature is reserved to public variables since there is no way to access other variables from the vbwDebugger.bas template file that is used to comunicate with the Debugger.
If you need to monitor a local variable, you must create a global variable, find every line where the local variable may change (don't forget procedures where the local var is passed as a ByRef argument !), and assign the global variable to the value of the local variable right after this line. Then of course monitor the value of the global variable.

Public GlobalVar As Long ' this variable will help monitoring the local variable

Sub SomeSub
  Dim LocalVar As Long
  GlobalVar = LocalVar ' re-init

  If SomeExpression Then
    LocalVar = LocalVar +1
    GlobalVar = LocalVar
    DoSomething LocalVar ' passed byref: it may be modified
    GlobalVar = LocalVar
  End If
End Sub

Sub DoSomething(ByRef i As Long)
    i = i + 1
End Sub


Initialization code

The Initialization code will be executed at startup (Sub Main or Form Load). This was designed to set which features should be turned on or off. For example, you may not want to activate by default the trace line feature which is time consuming, but only depending on the command line or a value in registry.