Debugger3.GetExpression(String, Boolean, Int32) Method

Definition

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.

EnvDTE::Expression GetExpression(std::wstring const & ExpressionText, bool UseAutoExpandRules = false, int Timeout = -1);
[System.Runtime.InteropServices.DispId(1)]
public EnvDTE.Expression GetExpression (string ExpressionText, bool UseAutoExpandRules = false, int Timeout = -1);
[<System.Runtime.InteropServices.DispId(1)>]
abstract member GetExpression : string * bool * int -> EnvDTE.Expression
Public Function GetExpression (ExpressionText As String, Optional UseAutoExpandRules As Boolean = false, Optional Timeout As Integer = -1) As Expression

Parameters

ExpressionText
String

The expression text to be evaluated.

UseAutoExpandRules
Boolean

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

Timeout
Int32

The timeout period in milliseconds.

Returns

An Expression.

Implements

Attributes

Examples

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  

Remarks

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.

Applies to