Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Sep 22, 2017 2:57 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: AddHandler / RemoveHandler
PostPosted: Sun May 12, 2013 4:07 am 
Offline

Joined: Sun Oct 17, 2010 9:46 am
Posts: 83
Location: Berlin, Germany
What is the best way to safely remove an event handler set by AddHandler if you don't know if it already has been removed? For a long time now I've used the following code:
#pragma BreakOnExceptions Off   // For debugging purposes
Try
RemoveHandler someObject.Action, AddressOf HandleAction
Catch err
// do nothing
End
#pragma BreakOnExceptions Default
This works fine but it needs quite a few rows of code where one should be sufficient. Does anybody have a better way to do this?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group