O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 Output is a string, the string is printed to the Output window.

  • If Output is a nonstring object, the ToString property of the Object object is invoked. This just outputs a string version of the name of the object.

  • Supplying a Category argument is useful when you want to organize the output from several Debug.Write statements by category. Output from the method then takes the form:

    Category: Output

    if Output is a string, and:

    Category: Output.ToString

    if Output is 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required