View Single Post
  #8 (permalink)  
Old 04-24-2008, 10:47 AM
dminder dminder is offline
Novice
Join Date: Apr 2008
Posts: 1
iTrader: (0)
dminder is on a distinguished road
Icon13 Don't Forget

This is my first time posting, happened across the boards when searching for something else. So Hello All!

Anyways, one thing that I find most useful especially when using Exit Sub is that if you have it within a Try...Catch...Finally statement, whatever is in the Finally part of the block will happen regardless of anything else. So, if you wanted to dispose of objects, disconnect from data sources, reset buttons, etc. before you exit the sub/function then you can put this all in the finally block and make sure it is done. However with exit do, while, for - unless the try...catch..finally block is encapsulated within them, the finally will not be triggered right away, it will complete whatever code is beyond them then once it either finishes with the sub/function or hits the exit sub/function command.

This can also be a deficit for the exact same reason, so be sure of what you put in there!!

Good Luck and Happy Coding!!

D

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by dminder : 04-24-2008 at 10:50 AM.
Reply With Quote