Why can’t I declare new variables in the immediate window?

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"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)