473,503 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4700
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2170
by: Kobu | last post by:
The code below isn't compiling for me (error message: conflicting types for 'total' - pointing to the extern declaration). Why wouldn't this work, since the types are different, the extern...
2
1137
by: Todd | last post by:
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...
1
4017
by: Acken | last post by:
Hi i have spent almost 2 days on these now..and cannot figure out what is wrong?! It seems so simple and innocent , but it is stumbling a novice of me. Please help to point out anything wrong and...
9
1488
by: nomadcontauroi | last post by:
iam wondering if a function name,say sum,could serve as an identifier? thanks.
17
2682
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I...
10
11761
by: teddarr | last post by:
I am trying to construct a class with several functions and identifiers. The identifier in question is static double AIR which will hold the value of the annual interest rate in the class. I have...
3
2716
by: parag_paul | last post by:
hi All for the following #include <stdio.h> typedef struct{ int a ; int b; char* j; } AST;
0
1425
by: Gordon Burditt | last post by:
>----------------------------- 8< ---------------------------------- Not if you include <string.h>, in which case the second paragraph above is an issue. Otherwise, it's OK. It's OK, but I...
21
3955
by: Thomas Pornin | last post by:
Hello, with gcc-4.2.3, this does not compile: typedef int foo; int f(foo) int foo; { return foo; }
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.