Flotsam and Jetsam #101

  • ITPerson

    Just got your Coding in Delphi book today (April 21,2015). Just glancing, read a bit about Exception handling. Haven’t used exceptions too much however one circumstance I did. A report had tons of sql code, therefore many ways for it to screw up. I numbered the exception errors so when they did have an issue I could find out exactly where to look to resolve. It worked well because aside from it notifying where to look, it still processed the rest normally. It didn’t just break and stop.

    Getting errors is a good thing to resolve them. In testing, its when someone else gets an error on their machine and meanwhile doing the exact same thing on your own and you never get an error, that’s when hunting it down gets stressful. I am more at ease to get reproducable errors. It means I can track em down.

    The other thing I find interesting at the beginning is the calculator class with the registration of new functions to that class. That really looks like it kicks ass! I remember being prohibited from writing components to use since others here (who don’t use Delphi) would not understand. However it didn’t stop me from trying out a few classes, one simple enough to implement I use it often.

    Currently working in two Delphi’s version 7 and XE7. I started a class in the XE7 and in that class I was doing “procedure” overloading. I went to do the same thing in Delphi 7, actually just carry the code over with some minor changes to uses clause and well… had to make every procedure uniquely named.

    Discussion about code to interfaces… (less is more)

    Zarko Gajic had an example use of RTTI which I thought was cool under Delphi.about.com called
    “Generic Solution to Coloring the Focused Entry Control” . A good example, except… I still do it the old way because sometimes a generic solution is “generic” and not specific. I really needed to understand this more in-depth which right now I don’t.