In debugging a recent program I found it useful to add a line at the top of every function and sub such as;
VB Code:
  1. Private Sub MySub
  2. If DebugMode Then WriteToLog("MySub")
By scanning down the log I can see the sequence of functions/subs that are running. So I can check that things are happening in the right order, no multiple loops, events are firing etc. Is this something I can already do in the IDE?, I can't see anything like this in the menus.

Also, is there a string function or something that returns the name of the current sub/function? So I could do something like;
VB Code:
  1. Private Sub MySub
  2. If DebugMode Then WriteToLog(NiftyFunction.CurrentSubFunction)
instead of having to add the debug lines mentioned individually?