I want to know if there is any way I can change the value of a variable during execution time, using Visual Studio 2008? I know I can do this on Eclipse (put a breakpoint, add a watcher and edit whatever variable value I want) but I didn't find this feature on VS yet?
Any idea?
Thanks.
yes ,it is possible to change the value of a variable while debugging in a c# application .
A constant is a data item whose value cannot change during the program's execution. Thus, as its name implies – the value is constant. A variable is a data item whose value can change during the program's execution.
You can change a variable in the Evaluate dialog or in the Watch List panel. The Evaluate dialog: To invoke the dialog, press the Call the Evaluate Dialog button on the Debug toolbar, or press the Ctrl+F12 shortcut (this is the default shortcut. You can change it any time.
A variable whose value can not be changed during the execution of the program is called a constant variable.
In VS if you hover your mouse over this variable, you'll notice it displays it's value in a tooltip. You can click into this tooltip and edit it manually - though you need to provide a value of the correct format for the data type. Strings also need quotes "".
There is likely a way to do this via some of the other debugging windows, but I don't know of any. I'll leave those answers to someone else.
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