using Command window in visual studio .net

It might be very simple question
I have a if loop
1 if i == 5
2 do this
3  else
4 do xyz
5 endif

While debugging,
I know at the line number 0 the value of i is 5 but I like to temporarily force execution to go to line 4 by making i =6
how can I do this in visual studio .net 2005?

thank you



tengu77Asked:
Who is Participating?
 
newyuppieConnect With a Mentor Commented:
and if you are debugging, and set a breakpoint before the loop, you can go to the immediate window and just type in
i=6

then continue execution (press f5)
0
 
newyuppieCommented:
easiest way would be to add a line after line 0 and before the loop that says i=6
0
 
newyuppieCommented:
alternatively set a breakpoint before the loop like before, and drag the yellow arrow to the line you want to get executed, bypassing the loop
0
 
Kinger247Commented:
You have a conditional statement 'if i == 5', you will aways run code where i=5.
Otherwise you need to change i, no way around it. Just add i=6 before it.

There are many ways including break points, conditional build statements etc,. but the bottom line is you need to run the conditional false code.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.