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

Jussi Lahtinen jussi.lahtinen at gmail.com
Thu Apr 20 23:57:52 CEST 2023


Here is a way to do what you want, but I don't really like it. See the
attachment.

Jussi

On Thu, Apr 20, 2023 at 11:36 PM Jussi Lahtinen <jussi.lahtinen at gmail.com>
wrote:

> No, sorry I messed up. Inherent private variables/subs/functions can only
> be overridden, not accessed.
> If class1 is merely a base class, then you can prevent its usage with
> "create private". But not just a single variable/method.
>
>
> Jussi
>
> On Thu, Apr 20, 2023 at 10:25 PM Mayost Sharon <sharon at 455.co.il> wrote:
>
>> Hello
>>
>> Is there a way to access a variable inherited from class1
>> but
>> that it will not be visible to other non-inherited classes
>>
>> something like this:
>> https://www.w3schools.com/cpp/cpp_inheritance_access.asp
>>
>> I tried to think maybe with: STATIC PRIVATE
>> But it's not working
>>
>>
>> Many thanks to everyone
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230421/d4db6472/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScopeDemo.tar.gz
Type: application/gzip
Size: 11981 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230421/d4db6472/attachment-0001.gz>


More information about the User mailing list