Reputation: 24198
Is it possible to alter a variable while debugging?
Say for example I have this code:
string x = "foo"; //would actually be a passed-in variable in the real world.
var y = "X equals " + x;
==>[BREAKPOINT] return x;
Is there a way to manually enter or otherwise change the value of "x" when I hit the break point? Also , is it possible to "step back" in the code in the same way that you can press F11
and step through it?
Upvotes: 1
Views: 81
Reputation: 9508
Yes, there are 2 ways to change a variable:
x = "a new value"
will change it. Also, if you want to check the value of x use ?x
If you would like to step to a different instruction, there are 2 ways to do that too:
Upvotes: 3