Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by A. Jetha
Wed, 29 Jul 1992 03:22
class messages
Author: A. Jetha
Date: Wed, 29 Jul 1992 03:22
Date: Wed, 29 Jul 1992 03:22
16 lines
739 bytes
739 bytes
This may seem like a dumb question, but how do you call a method in a
CustomClass from another method in the same CustomClass??
Eg.
CustomClass has 2 methods.
- helloThere
- seeYouTommorow
When I'm in, or done with, helloThere, how can I call
seeYouTommorow from within helloThere?
I hope someone can help.
Thanks
A.J.
ajetha@gpu.utcs.utoronto.ca
Re: class messages
Author: Hans Peter Geiser
Date: Thu, 30 Jul 1992 08:07
Date: Thu, 30 Jul 1992 08:07
32 lines
1137 bytes
1137 bytes
> This may seem like a dumb question, but how do you call a method in a
> CustomClass from another method in the same CustomClass??
>
> Eg.
> CustomClass has 2 methods.
> - helloThere
> - seeYouTommorow
>
> When I'm in, or done with, helloThere, how can I call
> seeYouTommorow from within helloThere?
>
As you name your methods - hello.. ( and not + hello...) I suppose you don't
mean messages that are sent to Classes but messages to objects.
This is easy done by using the global id self, that points always to the object
of the method you're in. Just do the following:
- helloThere
{
....
[self seeYouTomorrow];
...
return self;
}
- seeYouTomorrow
{
....
return self;
}
Hans - Peter Geiser
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads