New topic: 

AddHandler / RemoveHandler

<http://forums.realsoftware.com/viewtopic.php?t=47854>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        eliott          Post subject: AddHandler / RemoveHandlerPosted: 
Sun May 12, 2013 4:07 am                         
Joined: Sun Oct 17, 2010 9:46 am
Posts: 82
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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to