471,348 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

identifier out of scope

I'm getting what I think is a very strange result in ASP.NET. I have code as
follows inside a method:

string tempCol = "1";
string tempStr = "2";

My code wasn't working properly so I stepped through the code and found that
as soon as I get past the first line of code and the debugger is ready to
execute the 2nd line, I can't see the tempCol variable at all. It is not in
the Locals area at of the debugger and if I put my mouse over it and do a
Quick Watch, it says, "error: identifier 'tempCol' out of scope". I'm not
sure how this can be since it is right on the previous line and should still
be in scope. Help, I'm checking into the twilight zone!!!

--

Thanks in advance,

Todd
Jul 21 '05 #1
2 4585
JV
just guessing here, but...maybe the compiler realized that you were not
using the variable elsewhere in the script so optimized it out? Other than
that can't imagine how it could go out of scope on the very next line.
"Todd" <To**@discussions.microsoft.com>
I'm getting what I think is a very strange result in ASP.NET. I have code
as
follows inside a method:

string tempCol = "1";
string tempStr = "2";

My code wasn't working properly so I stepped through the code and found
that
as soon as I get past the first line of code and the debugger is ready to
execute the 2nd line, I can't see the tempCol variable at all. It is not
in
the Locals area at of the debugger and if I put my mouse over it and do a
Quick Watch, it says, "error: identifier 'tempCol' out of scope". I'm not
sure how this can be since it is right on the previous line and should
still
be in scope. Help, I'm checking into the twilight zone!!!

Jul 21 '05 #2
that is a good thought but unfortunately the variable is being used. i just
figured out that these variables are within an if statement and if i define
them outside the if-statement, they work fine. for example, i have

if (found)
{
string tempCol = "1";
string tempStr = "2";
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Todd | last post: by
1 post views Thread by Acken | last post: by
9 posts views Thread by nomadcontauroi | last post: by
3 posts views Thread by parag_paul | last post: by
reply views Thread by Gordon Burditt | last post: by
21 posts views Thread by Thomas Pornin | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.