Debugger.GetExpression(String, Boolean, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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
A Expression object.
- Attributes
Examples
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
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.