Reputation: 8098
for (i........)
{
//code
if (specimen == "AA161794")
Application.Run();
//more code
}
the if statement is there for debugging purposes. i need to examine some of the variables when specimen is that value. instead of application.run()
i just need a generic piece of code to put in there so that it can stop there. it can be something like
messagebox.show("Blah");
what is the correct way of doing this?
Upvotes: 2
Views: 201
Reputation: 4711
To use existing constant
# if DEBUG
Console.WriteLine("debug mode");
# endif
If you define your own constant "Legacy"
#if Legacy
Console.WriteLine("legacy mode");
# endif
Upvotes: 2
Reputation: 33242
Sure you can use Debugger.Break
http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx
Upvotes: 0
Reputation: 887195
You're trying to make a Conditional Breakpoint.
Right-click the breakpoint and click Condition...
.
Alternatively, write "".ToString();
Upvotes: 4
Reputation: 3412
Setting a Breakpoint in your IDE (visual studio or monodevelop)
here is a nice article of how to setup Conditional breakpoints
http://support.microsoft.com/kb/308469
Upvotes: 1