472,989 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 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 4677
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
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
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
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
by: nomadcontauroi | last post by:
iam wondering if a function name,say sum,could serve as an identifier? thanks.
17
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
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
by: parag_paul | last post by:
hi All for the following #include <stdio.h> typedef struct{ int a ; int b; char* j; } AST;
0
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
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; }
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.