This could save me so much time. Sometimes I find myself writing things like this in the watch or immediate window:
MyObject.Function1.Fuction2.Fuction3.Fuction2
Instead I could just declare several new variables and do this in a more structured way.
However doing this is not allowed.
Is there some way that i can do this? Is there going to be support for what I want in any future versions?
The Immediate window evaluates expressions by building and using the currently selected project. 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.
The differences between the Command and Immediate windowsThe Command window can load dlls or packages into the IDE as well. The Immediate window, on the other hand, is solely used during debugging and is useful to execute statements, print values of a contextual variable, or even evaluate expressions.
Right click on the variable in code, and select "Add Watch" Right click on the variable in the "Locals" windows, and select "Add Watch" Type the variable name into a new row in the Watch pane itself.
The immediate window can be displayed in several ways. One is to open the "Debug" menu and the "Windows" submenu then select "Immediate". In some configurations of Visual Studio this menu option may not be present. In this case, you can press Ctrl-Alt-I, or Ctrl-D,I in Visual Studio 2010.
Just answering the question from the headline:
In VS2015 you can declare variables in the immediate window. But you have to end your command with a semicolon:
var abc = "abcdef"; Expression has been evaluated and has no value
or
var n = 7; Expression has been evaluated and has no value
or
int o = 8; Expression has been evaluated and has no value
To show the result, just type the name of your variable:
abc "abcdef"
or
?abc "abcdef"
or
?abc; "abcdef"
or
abc; "abcdef"
Do not use Dim
jack = 12 ? jack 12 {Integer}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With