[Gambas-user] Question about inheritance

Benoit Minisini gambas at ...1...
Mon Jul 11 20:06:04 CEST 2005


On Friday 08 July 2005 19:01, PaquitoSoft wrote:
> Hello folks!
>
> I'm just starting to use classes in gambas since I've using only forms
> until now, and I found something to ask you about inheritance.
>
> I want to write a class which will be a child of Object[]. It will be a
> child because I want to store only one data type on it. I mean, you can
> store any Object in Object[], but in this child class I want to write
> you can only store objects of another class I wrote. So, my child class
> will have the same attributes/methods than Object[]; but I want to add
> it some extra methods.
>
> And here comes my question... If I want to use any parent method from
> its child I would use SUPER keyword, ins't it? Ok. One of my methods
> would look for one attribute in every stored object, but I don't know
> how to access stored objects... I mean, I can't see how Object[] class
> store objects an what name attribute it uses for this group of objects.
>
> Is there any way to access gambas classes from the IDE??
> If not, how can you know about this classes do so you can inherit from
> them??
>
> I apologize for my english.
> Thanks a lot guys!!!

If I understand well, you just need to access the array elements in your child 
class. Just use the [] operator. If you have redefined it (with the _get and 
_put method, just use SUPER with the [] operator to get them).

Regards,

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




More information about the User mailing list