[Gambas-user] Object Inheritance

Benoit Minisini gambas at ...1...
Tue Apr 6 22:07:54 CEST 2004


On Wednesday 07 April 2004 21:50, Fabien Bodard wrote:
> Le mardi 6 Avril 2004 00:15, Benoit Minisini a écrit :
> > On Monday 05 April 2004 20:35, Ronan Chilvers wrote:
> > > Hi folks
> > >
> > > Quick question on inheritance.  How does it work in gambas?  For
> > > example:-
> > >
> > > 2 classes
> > > 	MyParentClass
> > > 	MyChildClass
> > >
> > > and I want MyChildClass to inherit the properties and methods of
> > > myParentClass.  How do I do this ?
> > >
> > > Cheers
> > >
> > > Ronan
> >
> > Adds "INHERITS MyParentClass" to the beginning of MyChildClass.
> >
> > Regards,
>
> It seem to be not documented ... isn't it ?
>
> When have you had this feature benoit, i don't find it in the change
> log....
>
> Fabien
>
> Mabe when i was sleeping
>

Hum... Yes, it was not documented. And the feature is there since... gambas 
0.20 :-)

It is mainly used to make forms. Every form class defined in a project 
inherits the Form class.

Note that an interpreted class can inherits a native class. It works well for 
Form. But I didn't really tested what happened if you inherits something like 
Collection. It should work. But this is why I didn't claim it.

Well, now, everybody knows :-)

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list