Share via


Evaluate Method

Home Page (Objects)OverviewFAQReference

Applies to: Debugger object

Evaluates an expression, as if you typed it in the Visual C++ debugger's Watch window.

Syntax

object**.Evaluate(expression)**

Parameters

object

An expression that evaluates to a Debugger object.

expression

A String that represents the expression you want to evaluate.

Return Values

The Evaluate method returns a String containing the results of expression. For example, Debugger.Evaluate "2+2" returns "4" — not the number 4.

Example

The following example displays and then sets the value of an expression:

PrintToOutputWindow(Debugger.Evaluate("var"))
Debugger.Evaluate ("var=1")