GetExpression Method
This documentation is archived and is not being maintained.

Debugger.GetExpression Method

Evaluates an expression based on the current stack frame. If the expression can be parsed but not evaluated, an object is returned but will not contain a valid value.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

Expression GetExpression (
	[InAttribute] string ExpressionText,
	[OptionalAttribute] [InAttribute] bool UseAutoExpandRules,
	[OptionalAttribute] [InAttribute] int Timeout
)
Expression GetExpression (
	/** @attribute InAttribute() */ String ExpressionText, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean UseAutoExpandRules, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ int Timeout
)
function GetExpression (
	ExpressionText : String, 
	UseAutoExpandRules : boolean, 
	Timeout : int
) : Expression

Parameters

ExpressionText

The expression text to be evaluated.

UseAutoExpandRules

true if the auto expand rules should be used; otherwise, false.

Timeout

The timeout period, in milliseconds.

Return Value

A Expression object.

GetExpression evaluates an expression based on the current stack frame. If the expression can be parsed but not evaluated, an object is returned but will not contain a valid value.

The following example demonstrates how to use M:EnvDTE.Debugger.GetExpression(System.String,System.Boolean,System.Int32) property.

Sub DisplayExpression(Optional ByVal str As String = "")
    Dim expr As Expression
    expr = DTE.Debugger.GetExpression(str)

    If (expr.IsValidValue) Then
        MsgBox(expr.Name + " = " + expr.Value)
    Else
        MsgBox("Expression was not valid")
    End If

End Sub
Show:
© 2016 Microsoft