Is there a way to determine whether an object has an active listener?

something like

if (object.EventListener) then

end

(other than tracking it with a dedicated variable) [import]uid: 1560 topic_id: 1910 reply_id: 301910[/import]

I don’t believe there is a way to tell if a listener has been defined. You could add the feature yourself by assigning a new parameter to the object when you create the listener. It could be a Boolean or the listener address.

 obj.hasListener = true  
-- or  
 obj.hasListener = myListener -- assign the listener's address  

The above is a user-assigned parameter and doesn’t affect the object.

-Tom [import]uid: 7559 topic_id: 1910 reply_id: 5726[/import]

Although I’ve never tried, would it be possible to check if the obj table has an element named whatever the listener is called? [import]uid: 5833 topic_id: 1910 reply_id: 5742[/import]

No, you can’t see that information in the obj table unless you add it yourself.

-Tom [import]uid: 7559 topic_id: 1910 reply_id: 6193[/import]