[Gambas-user] Sub and Function hijack ?? is this possible ?

olivier coquet ocoquet at 3d-phenomen.fr
Wed Feb 17 16:54:18 CET 2021


Hi Brian, thanks a lot for tests and observations....

It took me some time to understand what you were telling me with _new().
I had thought of doing it the way it was originally but it has a major 
drawback:
The _new() procedure runs as soon as I instantiate out I wanted to be 
able to activate the plugin or not depending on certain states of my 
main program. So my solution allows to trigger the plugin start at the 
appropriate time.
For the rest (the dir....) totally agreed with you, I hadn't thought 
about it.
Remain to know, do you think it would be useful to create a gambas 
add-on for this kind of plugin management ????

friendship
Olivier C.

PS: for French language, deepl is our friend :)


Le 17/02/2021 à 14:03, Brian G a écrit :
> Yes I have tried, Cool way to add plugins.
>
> It took me a while to figure out the right way to name the component..
>   project name had to be 'myPlugin.plg' or some derivative...
>   I kept making it MaPlg1 , which it found but crashed because it was 
> also the component name .. lol
>
> I have attached a text file, as I look at your program.
>
> Suggest to use _new instead of running through all the plugins.
> _new is executed upon instantiation of an object. See text file.
>
> and add  Dir(Component.path, "*"&plgid&"*") filter to dir  so you 
> don't check every file.
>
> lol .. my french is very rusty.. have not really used it since high 
> school in Canada!
>
> I worked in Quebec for a while.. but still..
>
> Your example Works just fine!
>
>
> So Yes I tried you program ;)
>
> Brian G

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210217/7bfbadcd/attachment.htm>


More information about the User mailing list