Debugger3::GetExpression Method (String^, Boolean, Int32)

 

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

Namespace:   EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

Expression^ GetExpression(
	String^ ExpressionText,
	bool UseAutoExpandRules = false,
	int Timeout = -1
)

Parameters

ExpressionText
Type: System::String^

The expression text to be evaluated.

UseAutoExpandRules
Type: System::Boolean

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

Timeout
Type: System::Int32

The timeout period in milliseconds.

Return Value

Type: EnvDTE::Expression^

An Expression.

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 shows how to use the GetExpression method.

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

    If (expr.IsValidValue) Then
        MsgBox(expr.Name + " = " + expr.Value)
    Else
        MsgBox("Expression was not valid")
    End If
End Sub
Return to top
Show: