共用方式為


Print Command

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Evaluates an expression, or displays specified text.

Syntax

Debug.Print text

Arguments

text Required. The expression to evaluate or the text to display.

Remarks

You can use the question mark (?) as an alias for this command. So, for example, the command

>Debug.Print expA

can also be written

>? expA

Both versions of this command will return the current value of the expression expA.

Example

>Debug.Print varA

See Also

Evaluate Statement Command Visual Studio Commands Command Window Find/Command Box Visual Studio Command Aliases