[Gambas-user] Public and Private SUB in modules

Rolf-Werner Eilert eilert-sprachen at ...221...
Thu Dec 20 13:04:02 CET 2012


Errr - nope, doesn't run here:

Tried to change myPrinter_Draw() into _myPrinter_Draw(), and this is 
dysfunctional :-)

Never mind - I can live with it...

Rolf


Am 20.12.2012 11:55, schrieb Fabien Bodard:
> It can be masked by adding an underscore at the beginning of the event name
> Le 20 déc. 2012 11:38, "Benoît Minisini" <gambas at ...1...> a
> écrit :
>
>> Le 20/12/2012 11:27, Rolf-Werner Eilert a écrit :
>>> Hi,
>>>
>>> just a question to understand this phenomenon better:
>>>
>>> Why do event-SUBs have to be Public? It seems to me as if they don't run
>>> if I make them Private.
>>>
>>> For example, I have a module which handles an event-driven thing (like
>>> printing). I want to have all SUBs and Functions within this module to
>>> be invisible to the outside, and only those which directly communicate
>>> to the outer world should be Public. Thus when I am in another part of
>>> the program, the completion lists will only list those which actually
>>> play a role to outside the module.
>>>
>>> When I change myPrinter_Draw from Public to Private, it will not run
>>> anymore, however (just tried this). So I wonder why this is so, or in
>>> other words: why is it required to be Public to be found from within its
>>> own module?
>>>
>>> Thanks for your insights!
>>>
>>> Rolf
>>>
>>
>> "Public" means "can be accessed from the outside". So, as an event
>> handler needs to be accessed from the outside by definition (the event
>> comes from another object), it has to be public.
>>
>> --
>> Benoît Minisini
>>
>>
>> ------------------------------------------------------------------------------
>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>> Remotely access PCs and mobile devices and provide instant support
>> Improve your efficiency, and focus on delivering more value-add services
>> Discover what IT Professionals Know. Rescue delivers
>> http://p.sf.net/sfu/logmein_12329d2d
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list