Solved

using Command window in visual studio .net

Posted on 2006-11-26
5
428 Views
Last Modified: 2008-02-26
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



0
Comment
Question by:tengu77
  • 3
5 Comments
 
LVL 13

Expert Comment

by:newyuppie
ID: 18014529
easiest way would be to add a line after line 0 and before the loop that says i=6
0
 
LVL 13

Accepted Solution

by:
newyuppie earned 50 total points
ID: 18014535
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
 
LVL 13

Expert Comment

by:newyuppie
ID: 18014538
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
 
LVL 10

Expert Comment

by:Kinger247
ID: 18014594
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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now