Author
Topic: Query for EventHandlers (Read 4591 times)

While experimenting with events i noticed that you can add the same handler more than once but found no easy way to prevent this, other than define static variables remembering events already enabled.Such as

Hi Gile,Thanks you for replying and sorry for my late responding.While experimenting i noticed that i can remove the eventhandler without errors even if it is not defined.So for the code below I can always call REMEV as much as i like without calling ADDEV.The line "\nFailed to remove eventhandler" will never be executedSo i think the only solution is to add a variable eventsEnabled to prevent duplicated calls to ADDEV

Gr,Frits

However everytime you call ADDEV, new (duplicated) eventhandlers will be added.So