Reputation: 4359
While debugging, isn't there a way to "mouse over" a condition in an "if" statement to see if it evaluates to true or false in VS2010? I could have sworn there was, but I can't seem to get it to work.
Upvotes: 8
Views: 766
Reputation: 17186
As an option you can set your condition value to a bool variable and during debugging you can see it's value... Fore example:
bool condition = a > b;
if (condition)
{
// Do some stuff
}
And while debugging "mouse over" condition
.
Upvotes: 1
Reputation: 1850
Yes. Mouse-over the operator. For if(a || b)
, simply mouse-over the ||
.
You can even break down complex expressions. For if(a || !(b is string))
you can mouse-over the !(
portion to see what the result of the negation is.
Be sure you know your order of operations, though. For if(a || b && c)
, the ||
will give you the final result, where the &&
will give you the result of only the b && c
portion.
Upvotes: 7
Reputation: 43743
Yes, if you select/highlight the expression, then hover over the selected text, it will show you the evaluation of whatever is selected.
Upvotes: 1