SUPER:SUPER

SUPER:SUPER

Post by Geoff Schalle » Wed, 07 Mar 2001 22:59:30



Hey people,

Super:Super:... is not a valid construct. Is there some way I can skip an
inheritance level?  I would presume you should be able to (this is
particularly useful for skipping one level of Init(), for example) but don't
see how.

Any ideas?

Thanks.

Geoff

 
 
 

SUPER:SUPER

Post by Philippe Legro » Wed, 07 Mar 2001 23:28:18


Geoff,

Try the SendClass() function.

PhL


Quote:> Hey people,

> Super:Super:... is not a valid construct. Is there some way I can skip an
> inheritance level?  I would presume you should be able to (this is
> particularly useful for skipping one level of Init(), for example) but
don't
> see how.

> Any ideas?

> Thanks.

> Geoff


 
 
 

SUPER:SUPER

Post by Willie Moor » Wed, 07 Mar 2001 23:59:34


Geoff,

Have you tried self:owner:owner:somemethod() ?

Regards,

Willie


Quote:> Hey people,

> Super:Super:... is not a valid construct. Is there some way I can skip an
> inheritance level?  I would presume you should be able to (this is
> particularly useful for skipping one level of Init(), for example) but
don't
> see how.

> Any ideas?

> Thanks.

> Geoff

 
 
 

SUPER:SUPER

Post by Gary Star » Thu, 08 Mar 2001 08:10:51


Willie,

And owner is not - although it might be - a super of the derived class.

Consider the following ...

Class MyServer inherit dbServer

Class MyWindow inherit DataWindow

Method Init( ... ) Class MyWindow
    ...
    ...
    use MyServer

In this simple example, and using pretty well the defaults that CA would
provide, we would have, for the Server in MyWindow, an owner of MyWindow, whose
owner would (probably) be the Shell, but the super would be dbServer.

Phillipe's suggestion of SendClass() would be the way to achieve this.


> Geoff,

> Have you tried self:owner:owner:somemethod() ?

> Regards,

> Willie



> > Hey people,

> > Super:Super:... is not a valid construct. Is there some way I can skip an
> > inheritance level?  I would presume you should be able to (this is
> > particularly useful for skipping one level of Init(), for example) but
> don't
> > see how.

> > Any ideas?

> > Thanks.

> > Geoff

--
g.
Gary Stark

http://RedbacksWeb.com
 
 
 

SUPER:SUPER

Post by Allan Wissin » Thu, 08 Mar 2001 09:31:38


Geoff,

How about having a flag in your super:Init and pass the parameter when
calling

Class A

Class B inherit A

Method Init( lExec )
    if lExec
        ...
    else
        super:Init()
   endif

Class C inherit B

Method Init() Class C:
    super:Init( true )

 
 
 

SUPER:SUPER

Post by Linc » Thu, 08 Mar 2001 17:03:16


How about an very very stupid way :

Provide another init like MyInit() in your super class ??
I think you know how to use it.

or you like to provide an access method mysuper() in your super class ??

Access MySuper() Class [yoursuperclass]
Return Super

for example.

Access MySuper() Class DataWindow
Return Super

Class MyWindow Inherit DataWindow
Method Init(...) Class MyWindow
    Super:MySuper:Init(....)
Return Self

Well, I always doing stupid thing.    :)
Anyway, I say I am stupid first. Then, if you find anything wrong.....
Mmmmm.... I told you I am stupid...  :Q


Quote:> Hey people,

> Super:Super:... is not a valid construct. Is there some way I can skip an
> inheritance level?  I would presume you should be able to (this is
> particularly useful for skipping one level of Init(), for example) but
don't
> see how.

> Any ideas?

> Thanks.

> Geoff

 
 
 

SUPER:SUPER

Post by Geoff Schalle » Thu, 08 Mar 2001 18:18:49


Thanks, but that won't work. For example:

Class MyDataWin inherit DataWin
SendClass(oMyDataWin, #.....) ....

I can't get to DataWin directly because it doesn't exist as an object. You
can only Send to an object. I want to skip an inheritance level and, say,
bypass the DataWin:Init(), getting directly to the ChildAppWindow:Init().

Geoff


> Geoff,

> Try the SendClass() function.

> PhL


> > Hey people,

> > Super:Super:... is not a valid construct. Is there some way I can skip
an
> > inheritance level?  I would presume you should be able to (this is
> > particularly useful for skipping one level of Init(), for example) but
> don't
> > see how.

> > Any ideas?

> > Thanks.

> > Geoff

 
 
 

SUPER:SUPER

Post by Geoff Schalle » Thu, 08 Mar 2001 18:20:27


Yes, Allan, I think this is the way I will have to do it. Unfortunately that
means I can't do this to the GUI classes because I would have to re-write
them all but I can certainly do it to my inherited classes.

Geoff


Quote:> Geoff,

> How about having a flag in your super:Init and pass the parameter when
> calling

> Class A

> Class B inherit A

> Method Init( lExec )
>     if lExec
>         ...
>     else
>         super:Init()
>    endif

> Class C inherit B

> Method Init() Class C:
>     super:Init( true )

 
 
 

SUPER:SUPER

Post by Geoff Schalle » Thu, 08 Mar 2001 18:23:47


No its not stupid at all. This is in fact what I do now.

I use PreInit() <bg>.

However, it can't apply to the GUI classes without rewriting them all and it
cannot provide for the conditional bypassing of Init(). Not up to that, I'm
afraid <g>.

Geoff


> How about an very very stupid way :

> Provide another init like MyInit() in your super class ??
> I think you know how to use it.

> or you like to provide an access method mysuper() in your super class ??

> Access MySuper() Class [yoursuperclass]
> Return Super

> for example.

> Access MySuper() Class DataWindow
> Return Super

> Class MyWindow Inherit DataWindow
> Method Init(...) Class MyWindow
>     Super:MySuper:Init(....)
> Return Self

> Well, I always doing stupid thing.    :)
> Anyway, I say I am stupid first. Then, if you find anything wrong.....
> Mmmmm.... I told you I am stupid...  :Q



> > Hey people,

> > Super:Super:... is not a valid construct. Is there some way I can skip
an
> > inheritance level?  I would presume you should be able to (this is
> > particularly useful for skipping one level of Init(), for example) but
> don't
> > see how.

> > Any ideas?

> > Thanks.

> > Geoff

 
 
 

SUPER:SUPER

Post by Geoff Schalle » Thu, 08 Mar 2001 18:27:55


Hi Willie,

No not the Owner, I am talking about Super.

Class ChildAppWindow inherit AppWindow
Class DataWindow inherit ChildAppWindow
Class DataDialog inherit DataWindow
Class MyDataDialog inherit DataDialog
Class MyInvoiceDialog inherit MyDataDialog

Now, what I want to do (and not an actual real need...) I want to be able to
skip the DataDialog Init and go straight to the DataWindow Init.
MyDataDialog is the lowest class where my code exists. I want to bypass the
DataDialog methods and go to one level behind.

Geoff


> Geoff,

> Have you tried self:owner:owner:somemethod() ?

> Regards,

> Willie



> > Hey people,

> > Super:Super:... is not a valid construct. Is there some way I can skip
an
> > inheritance level?  I would presume you should be able to (this is
> > particularly useful for skipping one level of Init(), for example) but
> don't
> > see how.

> > Any ideas?

> > Thanks.

> > Geoff

 
 
 

SUPER:SUPER

Post by Geoff Schalle » Thu, 08 Mar 2001 18:30:01


Quote:>>Phillipe's suggestion of SendClass() would be the way to achieve this.

Unfortunately no. SendClass() sends to an object. I need to modify that
object's class heirarchy and bypass some of it.

Geoff

 
 
 

SUPER:SUPER

Post by Gary Star » Thu, 08 Mar 2001 18:26:11


Geoff,

Why do you say that  this won't work ?

SendClass( oMyDataWin, #Init, #ChildAppWindow )

It sounds to me as if it's exactly what you're saying that you want, although
calling the Init() might cause some issues for you, given that you would have
already called the Self:Init() method as soon as you instantiate the object.


> Thanks, but that won't work. For example:

> Class MyDataWin inherit DataWin
> SendClass(oMyDataWin, #.....) ....

> I can't get to DataWin directly because it doesn't exist as an object. You
> can only Send to an object. I want to skip an inheritance level and, say,
> bypass the DataWin:Init(), getting directly to the ChildAppWindow:Init().

> Geoff



> > Geoff,

> > Try the SendClass() function.

> > PhL


> > > Hey people,

> > > Super:Super:... is not a valid construct. Is there some way I can skip
> an
> > > inheritance level?  I would presume you should be able to (this is
> > > particularly useful for skipping one level of Init(), for example) but
> > don't
> > > see how.

> > > Any ideas?

> > > Thanks.

> > > Geoff

--
g.
Gary Stark

http://RedbacksWeb.com
 
 
 

SUPER:SUPER

Post by Gary Star » Thu, 08 Mar 2001 18:33:52


Geoff,

Yes, Sendclass sends to an object. That's its purpose. A method - which is
what you're sending - can only act upon an object.

But, you're telling that object - which must exist - to execute a method of
some other specified class. In this case, it's the super class of that
object.

But without that object, what you're trying to do is meaningless: how do you
expect to execute a method on a non-existant object? There is nothing to act
upon.


> >>Phillipe's suggestion of SendClass() would be the way to achieve this.

> Unfortunately no. SendClass() sends to an object. I need to modify that
> object's class heirarchy and bypass some of it.

> Geoff

--
g.
Gary Stark

http://RedbacksWeb.com
 
 
 

SUPER:SUPER

Post by Gary Star » Thu, 08 Mar 2001 18:30:41


Geoff,

Why would you need to re-write the GUI classes? WHile I don;t know if this will
work ...

Class MyClass Inherit DataWindow

Method Init Class MyClass

    sendclass( self, #Init, #ChildAppWindow )

I suspect that with good use of inheritance, you should be able to do what you
need without rewriting the GUI. I know that my own classes do what I want, and
I've certainly not done anything like rewriting the GUI.

Remember that once you've done this, your class becomes available in the WED.


> Yes, Allan, I think this is the way I will have to do it. Unfortunately that
> means I can't do this to the GUI classes because I would have to re-write
> them all but I can certainly do it to my inherited classes.

> Geoff



> > Geoff,

> > How about having a flag in your super:Init and pass the parameter when
> > calling

> > Class A

> > Class B inherit A

> > Method Init( lExec )
> >     if lExec
> >         ...
> >     else
> >         super:Init()
> >    endif

> > Class C inherit B

> > Method Init() Class C:
> >     super:Init( true )

--
g.
Gary Stark

http://RedbacksWeb.com
 
 
 

SUPER:SUPER

Post by Linc » Thu, 08 Mar 2001 19:05:15


The second option don't work ?
Access MySuper() something.....


> No its not stupid at all. This is in fact what I do now.

> I use PreInit() <bg>.

> However, it can't apply to the GUI classes without rewriting them all and
it
> cannot provide for the conditional bypassing of Init(). Not up to that,
I'm
> afraid <g>.

> Geoff



> > How about an very very stupid way :

> > Provide another init like MyInit() in your super class ??
> > I think you know how to use it.

> > or you like to provide an access method mysuper() in your super class ??

> > Access MySuper() Class [yoursuperclass]
> > Return Super

> > for example.

> > Access MySuper() Class DataWindow
> > Return Super

> > Class MyWindow Inherit DataWindow
> > Method Init(...) Class MyWindow
> >     Super:MySuper:Init(....)
> > Return Self

> > Well, I always doing stupid thing.    :)
> > Anyway, I say I am stupid first. Then, if you find anything wrong.....
> > Mmmmm.... I told you I am stupid...  :Q



> > > Hey people,

> > > Super:Super:... is not a valid construct. Is there some way I can skip
> an
> > > inheritance level?  I would presume you should be able to (this is
> > > particularly useful for skipping one level of Init(), for example) but
> > don't
> > > see how.

> > > Any ideas?

> > > Thanks.

> > > Geoff

 
 
 

1. SUPER:SUPER

How can I implement a SUPER:SUPER in a Method ??
I am using VO2.5a-1

--
Good Software is a Process of Evolution,
it is not Created

Anthony Smith

instead of spam use Datamax to reply

2. Help! FP2002 Not Saving Password

3. Super-linear (super-critical) algorithms needed

4. Newbie: How to publish WordPerfect Docs for WWW