Re: Null out the current object... possible?
From: AC (AC_at_discussions.microsoft.com)
Date: 11/13/04
- Next message: AC: "Re: Null out the current object... possible?"
- Previous message: Joerg Jooss: "Re: Get XML file!?"
- In reply to: Rene: "Re: Null out the current object... possible?"
- Next in thread: Richard Blewett [DevelopMentor]: "Re: Null out the current object... possible?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 13 Nov 2004 03:44:01 -0800
Nice analogy...
I could do that, and I am... just wondering if this was possible.
"Rene" wrote:
> The object can't destroy itself. Its like if a person tried to eat his or
> herself (don't get nasty now) it will come down to the point where the mouth
> will have to eat the mouth and that is not possible!
>
>
>
> If you need to destroy it, why not have the object that calls the "Delete"
> method of the class also set the object to null?
>
>
> "AC" <AC@discussions.microsoft.com> wrote in message
> news:07CCD0E4-35C1-4C3C-A764-F7624306DB7D@microsoft.com...
> >I have the need to destory the current object when a method is called.
> >Such
> > as:
> >
> > public class Animal{
> > public string animalType = string.Empty;
> > public void Delete(){
> > this = null;
> > }
> > }
> >
> > When I compile it, it throws an error. Is this not possible? I know the
> > user of class Animal can set it to null on his own, but was hoping I could
> > do
> > this.
> >
> > -AC
>
>
>
- Next message: AC: "Re: Null out the current object... possible?"
- Previous message: Joerg Jooss: "Re: Get XML file!?"
- In reply to: Rene: "Re: Null out the current object... possible?"
- Next in thread: Richard Blewett [DevelopMentor]: "Re: Null out the current object... possible?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|