-
Apr 27th, 2009, 10:17 PM
#1
Thread Starter
Frenzied Member
New Immediate Window session?
How do you start a new session? Like if I was to type in
Code:
Class a = new Class1();
How do I clear "a" and the rest of the variables from the scope?
-
Apr 28th, 2009, 08:23 AM
#2
Re: New Immediate Window session?
To clear your class you can simply type
Beware that even though you've 'nullified' it, it won't be really gone until the garbage collector has disposed of it. That won't be a problem for your application though.
But what do you mean with 'start a new session'?
I code C#....
-
Apr 28th, 2009, 09:43 AM
#3
Re: New Immediate Window session?
Originally Posted by vbcode1980
what do you mean with 'start a new session'?
I believe he means to close the current scope and open a new one. In normal code you declare a variable and it exists only within the block it's declared in. Once that block ends the variable ceases to exist. In the case of the Immediate window I don't believe that there's any way to force a variable that you've declared out of scope. I've never seen it done and I couldn't find any indication that it's possible in my own reading. That doesn't mean that it's not possible but they've hidden it pretty well if it is.
Interestingly, I wonder what happens if you declare a variable in the Immediate window and then a variable with the same name comes into scope as you step through your code. If you get the value of the variable with that name, which one will you get. Might check that out tomorrow, or today as it's 12:42 AM. Best off to sleeps.
-
Apr 29th, 2009, 12:04 AM
#4
Thread Starter
Frenzied Member
Re: New Immediate Window session?
Hm, Building the project (even if it is up to date) seems to do it. Although hoping there is a better way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|