[Gambas-user] protected for a variable inherited from a class

Mayost Sharon sharon at 455.co.il
Sat Apr 22 20:33:18 CEST 2023


---------- Original Message -----------
From: Jussi Lahtinen <jussi.lahtinen at gmail.com>
To: Gambas Mailing List <user at lists.gambas-basic.org>
Sent: Fri, 21 Apr 2023 21:32:30 +0300
Subject: Re: [Gambas-user] protected for a variable inherited from a class

> >
> > 1. You seem to be what you were seemingly to achieve through:
> > Static Public Function GetPrivate() As Integer
> > (that doesn't work either)
> >
> 
> Like Lee said, change the iVar declaration to static and then it is
> possible.
> 
> 2. In your example, still when I register hObj1 and a period in the IDE, it
> > completes me and shows me that there is a GetPrivate method. I'm looking
> > for a way that it won't show it to me when I create an instance of CLASS1
> > but when I'm in CLASS2 which is an inheritance of CLASS1 so Inside it will
> > be possible to access CLASS1.GetPrivate
> >
> 
> I guess there is some language barrier issue. I don't really understand
> what you are trying to achieve.
> If you have static access to class1 function (class1.GetPrivate), then you
> will have dynamic access also (hObj.GetPrivate, where hObj is an instance
> of class1).
> There doesn't seem to be a way to detect this in Gambas.
> 
> If you don't want a function of class1 to be accessed, then why is the
> function in class1? Why not in class2?
> 
> Jussi
------- End of Original Message -------

Sorry
You are very right

Unfortunately I have a barrier and I don't know English properly so I have to translate my questions through
Google translation
(I hope this translation turned out well)

That's why I tried at the beginning of the message to show an example I saw in C that does what I'm looking for

Many thanks to everyone


More information about the User mailing list