Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

using Command window in visual studio .net

Posted on 2006-11-26
5
432 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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