[Gambas-user] protected for a variable inherited from a class
Mayost Sharon
sharon at 455.co.il
Sat Apr 22 20:24:55 CEST 2023
---------- Original Message -----------
From: T Lee Davidson <t.lee.davidson at gmail.com>
To: user at lists.gambas-basic.org
Sent: Fri, 21 Apr 2023 10:57:40 -0400
Subject: Re: [Gambas-user] protected for a variable inherited from a class
> On 4/20/23 23:53, Mayost Sharon wrote:
> > 1. You seem to be what you were seemingly to achieve through:
> > Static Public Function GetPrivate() As Integer
> > (that doesn't work either)
>
> Of course it doesn't work. The value that function returns is dynamic not
> static. Static and dynamic methods and variables cannot be mixed.
>
> > 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
>
> If CLASS2 has inherited CLASS1, then it has also inherited the GetPrivate
> method and, therefore, it then makes no sense to attempt to access that method
> with a syntax of CLASS1.GetPrivate. If you wish to access it with that syntax,
> then don't inherit CLASS1 in CLASS2.
>
> Now why does it matter to you what the IDE auto-completion function shows you?
>
> --
> Lee
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
------- End of Original Message -------
Because if I end up creating a component
It better be arranged as perfect components work
More information about the User
mailing list