Share via


Debugger2.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 does not contain a valid value.

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

Syntax

'Declaration
Function GetExpression ( _
    ExpressionText As String, _
    UseAutoExpandRules As Boolean, _
    Timeout As Integer _
) As Expression
Expression GetExpression(
    string ExpressionText,
    bool UseAutoExpandRules,
    int Timeout
)
Expression^ GetExpression(
    [InAttribute] String^ ExpressionText, 
    [InAttribute] bool UseAutoExpandRules, 
    [InAttribute] int Timeout
)
abstract GetExpression : 
        ExpressionText:string * 
        UseAutoExpandRules:bool * 
        Timeout:int -> Expression
function GetExpression(
    ExpressionText : String, 
    UseAutoExpandRules : boolean, 
    Timeout : int
) : Expression

Parameters

  • ExpressionText
    Type: String
  • UseAutoExpandRules
    Type: Boolean

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

  • Timeout
    Type: Int32

    The timeout period in milliseconds.

Return Value

Type: EnvDTE.Expression
An Expression.

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.

Examples

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

.NET Framework Security

See Also

Reference

Debugger2 Interface

EnvDTE80 Namespace