Hey guys,
I'm having a problem. And I can't figure this one out.
It's quite simple. I am in a Visual Studio 2003 web application project. I am in a method. Inside an if statement, I declare a local variable. I give it a value. When debugging, if I put a watch on this variable after it has been asigned, I get a little error -
error: identifier 'i' out of scope
My code is something like this -
string k = "";
if (ready == true)
{
int i = 1234;
k = i + " cabbages";
}
What's really odd, is that the variable k will be absolutely fine. But i, after it has been assigned, is apparently 'out of scope'. What's strange, is that k is assigned '1234 cabbages' correctly. So the value is correct, just debugging is not.
I've been doing this for a while, but I just don't get it.
I've rebuilt, I've made sure that the 'Optimise Code' is set to false.
What else can I do?
Cheers,
B