Immediate Mode, Command Window

The Immediate mode of the Command window is used for debugging purposes such as evaluating expressions, executing statements, printing variable values, and so forth. It allows you to enter expressions to be evaluated or executed by the development language during debugging. In some cases, you can change the value of variables. The Immediate mode now also supports Intellisense.

You can also temporarily issue Visual Studio .NET commands in Immediate mode. This can be useful if you are debugging an application and using Immediate **** mode to view or change the value of variables but still want to interact with the interactive development environment (IDE) using commands.

Note   To issue a single Visual Studio .NET command while in Immediate mode, you must preface the command with a greater than sign (>). For example, to switch to Command mode from Immediate mode, you must preface the command with a greater than sign (>). To enter multiple commands, switch to Command mode.

Once in a project, the Command window can be opened in Immediate mode by pressing CTRL+ALT+I, or by choosing Immediate on the Windows submenu of the Debug menu. When the Command window is in Immediate mode, the title bar displays the text Command Window - Immediate.

In Command mode, statements separated by the equal sign (=) are evaluated as comparison operators. For example, if the value of variables a and b are different, then >? a = b returns a value of False. In Immediate mode, however, the statement a=b is evaluated as an assignment operation rather than a comparison operation. That is, a=b assigns the value of variable a to the value of variable b. You cannot use assignment operations in Command mode.

Unlike previous versions of the Immediate **** window, the UP ARROW and DOWN ARROW keys do not move the cursor to previous commands, but rather allow you to scroll through previously issued commands.

Task Solution Example
Temporarily enter Command mode while in Immediate mode (to execute a single command). Enter the command, prefacing it with a greater than sign (>). >alias
Switch to Command mode from Immediate mode. Enter cmd into the window, prefacing it with a greater than sign (>). >cmd
Switch back to Immediate mode from Command mode. Enter immed into the window without the greater than sign (>). immed
Evaluate an expression. Preface the expression with a question mark (?). ?a+b

Note   Commands typed in Command mode are not prefaced by the greater than sign (>) because it is the command prompt in that mode. You must enter the greater than sign (>), however, when issuing Visual Studio .NET commands while in Immediate mode.

Mark Mode

Mark mode in the Command window allows you to select, copy, and paste text in it or to re-execute previous commands. Enter Mark mode by clicking on a previous line in the Command window (in either Command or Immediate mode), or by choosing Mark Mode from the context menu, or by pressing CTRL + SHIFT + M. Once in Mark mode, you can use either the context commands or their keyboard equivalents to cut, copy, paste, or clear text in the window.

See Also

Command Window | Command Mode, Command Window