Name
Debug.Write Method
Class
System.Diagnostics.Debug
Syntax
Debug.Write(Output[,Category])
-
Output(required; String or Object) The string to be sent to the Output window, or the object whose name is to be sent to the Output window
-
Category(optional; String) A category name used to group output messages
Description
Prints text in the Output window in the design-time environment
Rules at a Glance
If
Outputis a string, the string is printed to the Output window.If
Outputis a nonstring object, the ToString property of theObjectobject is invoked. This just outputs a string version of the name of the object.Supplying a
Categoryargument is useful when you want to organize the output from severalDebug.Writestatements by category. Output from the method then takes the form:Category: Output
if
Outputis a string, and:Category: Output.ToString
if
Outputis a nonstring object.
Programming Tips and Gotchas
In Visual Basic applications, Debug.Write executes only when an application is run in the design-time environment; the statement has no effect in a compiled application.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access