Using the Message Trace Window
Message tracing lets you create a history of method calls. You can access the Message Trace window from the Debug menu by selecting Windows and then Message Trace. Since messages are really procedure and function calls, a message trace can be thought of as a call stack history. Messages are displayed in a tree view hierarchy.
Message tracing is useful when you need to review an entire operation (e.g., the finding of a record) and get a quick overview of the methods involved.
To create a message history, follow these steps:
- Execute your program and get it ready to start the process you wish to record.
- Turn on the message tracing:
- Right-click in the Message Trace window.
- Check Trace Messages from the context menu.
- Return to your application and run the process.
- When the process is complete, turn off the message trace:
- Right-click in the Message Trace window.
- Uncheck Trace Messages.
You can now study the message trace history and try to determine what is happening in your program. During your review process of the message trace, you can automatically display the appropriate source code for any message in the source window by double-clicking the message in the tree view.
While the message trace provides you with a history of a process, it does not record the values of variables and properties. To do this, you will need to set a breakpoint and step through your source. Often, tracing will show you where you need to place your breakpoints.
Message Filters
Sometimes a message trace can be overwhelming with too much information, so you might want to filter out certain messages. You can access the Filter Options by right-clicking the Message Trace window and selecting Filter Options from the context menu.
You can also select a specific message in the Message Trace window, right-click, and select Filter. This will automatically add the specified message to the filter.
A few specific messages are filtered by default, which typically occur very often and are usually of little interest.
Note that filters do not apply to the Message Trace window itself; they apply to methods as they’re called.