Skip to content

Commit 19805e7

Browse files
committed
sync
2 parents 8001b82 + c27793e commit 19805e7

File tree

6 files changed

+84
-67
lines changed

6 files changed

+84
-67
lines changed

docs/ide/immediate-window.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use the Immediate Window
33
description: Learn how to use the Immediate window to debug and evaluate expressions, execute statements, and print variable values.
4-
ms.date: 02/25/2019
4+
ms.date: 08/05/2025
55
ms.topic: how-to
66
dev_langs:
77
- VB
@@ -18,21 +18,25 @@ ms.subservice: general-ide
1818
---
1919
# Use the Immediate window
2020

21-
Use the **Immediate** window to debug and evaluate expressions, execute statements, and print variable values. The **Immediate** window evaluates expressions by building and using the currently selected project.
21+
This article explains how to use the **Immediate** window to debug and evaluate expressions, execute statements, and print variable values. The **Immediate** window evaluates expressions by building and using the currently selected project.
2222

23-
To display the **Immediate** window, open a project for editing, and then choose **Debug** > **Windows** > **Immediate** or press **Ctrl**+**Alt**+**I**. You can also enter **Debug.Immediate** in the **Command** window.
23+
To display the **Immediate** window, first open a project to edit, and then choose **Debug** > **Windows** > **Immediate** or press **Ctrl**+**Alt**+**I**. You can also enter *Debug.Immediate* in the **Command** window.
2424

2525
The **Immediate** window supports IntelliSense.
2626

2727
## Display the values of variables
2828

29+
<<<<<<< HEAD:docs/ide/immediate-window.md
2930
The **Immediate** window is particularly useful when you're debugging an app. For example, to check the value of a variable `varA`, you can use the [Print command](../ide/reference/print-command.md):
31+
=======
32+
The **Immediate** window is useful when you debug an app. For example, to check the value of a variable `varA`, you can use the [Print command](../../ide/reference/print-command.md):
33+
>>>>>>> c27793e89a96e4d1c4f009ef77e4299987778a94:docs/ide/reference/immediate-window.md
3034
3135
```cmd
3236
>Debug.Print varA
3337
```
3438

35-
The question mark (?) is an alias for `Debug.Print`, so this command can also be written:
39+
The question mark (`?`) is an alias for `Debug.Print`, so this command can also be written:
3640

3741
```cmd
3842
? varA
@@ -41,7 +45,11 @@ The question mark (?) is an alias for `Debug.Print`, so this command can also be
4145
Both versions of this command return the value of the variable `varA`.
4246

4347
> [!TIP]
48+
<<<<<<< HEAD:docs/ide/immediate-window.md
4449
> To issue a Visual Studio command in the **Immediate** window, you must preface the command with a greater than sign (>). To enter multiple commands, switch to the [Command window](../ide/reference/command-window.md).
50+
=======
51+
> To issue a Visual Studio command in the **Immediate** window, you must preface the command with a greater than sign (`>`). To enter multiple commands, switch to the [Command window](command-window.md).
52+
>>>>>>> c27793e89a96e4d1c4f009ef77e4299987778a94:docs/ide/reference/immediate-window.md
4553
4654
## Design-time expression evaluation
4755

@@ -65,23 +73,27 @@ You can use the **Immediate** window to execute a function or subroutine at desi
6573
End Module
6674
```
6775

68-
2. On the **Debug** menu, choose **Windows** > **Immediate**.
76+
1. On the **Debug** menu, choose **Windows** > **Immediate**.
6977

70-
3. Type `?MyFunction(2)` in the **Immediate** window and press **Enter**.
78+
1. Type `?MyFunction(2)` in the **Immediate** window and press **Enter**.
7179

7280
The **Immediate** window runs `MyFunction` and displays `4`.
7381

82+
<<<<<<< HEAD:docs/ide/immediate-window.md
7483
If the function or subroutine contains a breakpoint, Visual Studio breaks execution at the appropriate point. You can then use the debugger windows to examine your program state. For more information, see [Walkthrough: Debugging at Design Time](../debugger/walkthrough-debugging-at-design-time.md).
84+
=======
85+
If the function or subroutine contains a breakpoint, Visual Studio breaks execution at the appropriate point. You can then use the debugger windows to examine your program state. For more information, see [Walkthrough: Debug at design time](../../debugger/walkthrough-debugging-at-design-time.md).
86+
>>>>>>> c27793e89a96e4d1c4f009ef77e4299987778a94:docs/ide/reference/immediate-window.md
7587
7688
You can't use design-time expression evaluation in project types that require starting up an execution environment, including Visual Studio Tools for Office projects, web projects, Smart Device projects, and SQL projects.
7789

7890
### Design-time expression evaluation in multi-project solutions
7991

80-
When establishing the context for design-time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected in Solution Explorer, Visual Studio attempts to evaluate the function against the startup project. If the function cannot be evaluated in the current context, you'll receive an error message. If you're attempting to evaluate a function in a project that's not the startup project for the solution and you receive an error, try selecting the project in Solution Explorer and attempt the evaluation again.
92+
When establishing the context for design-time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected in Solution Explorer, Visual Studio attempts to evaluate the function against the startup project. If the function can't be evaluated in the current context, you receive an error message. If you're attempting to evaluate a function in a project that's not the startup project for the solution and you receive an error, try selecting the project in Solution Explorer and attempt the evaluation again.
8193

8294
## Enter commands
8395

84-
Enter the greater than sign (>) when issuing Visual Studio commands in the **Immediate** window. Use the **Up arrow** and **Down arrow** keys to scroll through your previously used commands.
96+
Enter the greater than sign (`>`) when issuing Visual Studio commands in the **Immediate** window. Use the **Up arrow** and **Down arrow** keys to scroll through your previously used commands.
8597

8698
|Task|Solution|Example|
8799
|----------|--------------|-------------|
@@ -92,7 +104,7 @@ Enter the greater than sign (>) when issuing Visual Studio commands in the **Imm
92104

93105
## Mark mode
94106

95-
When you click on any previous line in the **Immediate** window, you shift automatically into Mark mode. This allows you to select, edit, and copy the text of previous commands as you would in any text editor, and paste them into the current line.
107+
When you select any previous line in the **Immediate** window, you shift automatically into Mark mode. This allows you to select, edit, and copy the text of previous commands as you would in any text editor, and paste them into the current line.
96108

97109
## Examples
98110

@@ -118,15 +130,24 @@ In some settings configurations, first-chance exception notifications are displa
118130

119131
### Toggle first-chance exception notifications in the Immediate window
120132

121-
1. On the **View** menu, click **Other Windows**, and click **Output**.
133+
1. On the **View** menu, select **Output**.
122134

123135
2. Right-click on the text area of the **Output** window, and then select or deselect **Exception Messages**.
124136

125-
## See also
137+
## Related content
126138

139+
<<<<<<< HEAD:docs/ide/immediate-window.md
127140
- [Navigating through Code with the Debugger](../debugger/navigating-through-code-with-the-debugger.md)
128141
- [Command Window](../ide/reference/command-window.md)
129142
- [First look at the debugger](../debugger/debugger-feature-tour.md)
130143
- [Walkthrough: Debugging at Design Time](../debugger/walkthrough-debugging-at-design-time.md)
131144
- [Visual Studio Command Aliases](../ide/reference/visual-studio-command-aliases.md)
132145
- [Using Regular Expressions in Visual Studio](../ide/using-regular-expressions-in-visual-studio.md)
146+
=======
147+
- [Navigating through code by using the debugger](../../debugger/navigating-through-code-with-the-debugger.md)
148+
- [Command Window](../../ide/reference/command-window.md)
149+
- [Overview of the debugger](../../debugger/debugger-feature-tour.md)
150+
- [Debug at design time](../../debugger/walkthrough-debugging-at-design-time.md)
151+
- [Visual Studio Command Aliases](../../ide/reference/visual-studio-command-aliases.md)
152+
- [Use regular expressions in Visual Studio](../../ide/using-regular-expressions-in-visual-studio.md)
153+
>>>>>>> c27793e89a96e4d1c4f009ef77e4299987778a94:docs/ide/reference/immediate-window.md

0 commit comments

Comments
 (0)