[Gambas-user] General event handler

Bruce adamnt42 at gmail.com
Sat May 1 01:36:31 CEST 2021


On 1/5/21 8:48 am, Benoît Minisini wrote:
> Le 01/05/2021 à 01:16, Bruce a écrit :
>> In PL1 there is a condition called "Any$" that makes it possible to 
>> write a generalised event handler "On_Any$" that is executed for any 
>> other condition that does not have a specific handler. Thus if there 
>> is a divide by zero occurrence and there is no "On_DivZero$" handler 
>> then On_Any$ is executed.
>>
>> Do we have a way to do the same in Gambas? Like in the startup class 
>> have a method, say "Application_Any$", that could trap any event 
>> raised by any object.
>>
>> bruce
>>
> 
> No. What for?
> 
At the moment, just for development/debugging purposes. But I can 
envisage using it where some class "X" raises an event that is not 
handled by the class that instantiates an X object.

Currently I have a situation where some events are firing in an 
unexpected order from a set of objects. If I step through the code in 
the IDE they fire in the expected order (of course) but when I run the 
project sometimes they appear to be out of order. If I could just detect 
the firing order or the handler order I might be able to understand.

bruce


More information about the User mailing list