I think this is nice functionality:

I think this is nice functionality:
http://www.thedelphigeek.com/2013/02/running-any-code-when-method-ends.html

Comments

  1. This is an often used feature. Have used it to auto destroy locally created objects, for measuring times, logging etc.

    ReplyDelete
  2. Yup, I've got similar code in my toolbox.

    ReplyDelete
  3. I think it's very dangerous and would rather use explicit code :-)
    Less appealing aesthetically maybe but much better in the grand scheme of things :-)

    ReplyDelete
  4. It's only dangerous if you don't know how interfaces work. :-)

    ReplyDelete
  5. I disagree, I am against the whole concept of Any code just because, well, of any possible code ;-)
    See what I mean?

    ReplyDelete
  6. Doh! :facepalm: The only thing I can offer is that I hadn't yet had my coffee.

    ReplyDelete
  7. Poor man's RAII. I'd prefer EMB to implement record destructors and friends so we can do it properly. Tho without scoped variables it may not be that useful...

    ReplyDelete

Post a Comment