Paul Clements wrote:
Ah, ok. That makes it clearer. What you're saying is that the 'finally' code always executes, even if you exit out of the try/catch with a return, or as Henry says, receive an unhandled exception.
Using
finally with
return, meaning the ability to run code after a value is returned, actually has cool possibilities. For example, I can do a post increment getter like this...
And yes, I know, it could be done more simply with just a "return seqNum++;" ...
... but what if the post return operation was more complex than just an increment?
Henry