473,657 Members | 2,376 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 4711
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**@discussio ns.microsoft.co m>
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
2180
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 declaration obviously refers to the 'long total' in total.c? Is my compiler wrong? total.c
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 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...
1
4026
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 many thanks in advance!!! "currentVal" below is identified as undeclared identifier in lines //??. I thought it was already defined as BYTE (which was typedef unsigned char) in another header file. static char* g_rgWorksheetFuncs;
9
1502
by: nomadcontauroi | last post by:
iam wondering if a function name,say sum,could serve as an identifier? thanks.
17
2692
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 can retrieve the autonum value for the new record. This doesn't occur with SQL Server, which of course causes an error (or at least in this code it does since there's an unhandled NULL value). Is there any way to retrieve this value when I add a...
10
11783
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 been getting an error message that I can't seem to get rid of: error C2065: 'AIR' undeclared identifier I have never worked with static identifiers before and I think I'm leaving something out somewhere but I don't know what. Here's the...
3
2725
by: parag_paul | last post by:
hi All for the following #include <stdio.h> typedef struct{ int a ; int b; char* j; } AST;
0
1436
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 think it would be less confusing if you named it something else.
21
3975
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
8399
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1622
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.