Jump to content

David Heffernan

Members
  • Content Count

    3494
  • Joined

  • Last visited

  • Days Won

    172

Everything posted by David Heffernan

  1. David Heffernan

    Is a "bare-minimum" EurekaLog possible?

    Just trying to use inner exceptions in my own project (which has madExcept) and also feeling the pain .....
  2. David Heffernan

    docwiki.embarcadero.com is not working

    It's amazing how low expectations have become. "It sometimes works, sort of, if you refresh the page a few times" "You might get better results by spoofing your IP with a VPN"
  3. David Heffernan

    docwiki.embarcadero.com is not working

    Perhaps they don't know it's broken?
  4. David Heffernan

    docwiki.embarcadero.com is not working

    Imagine not being able to get your company's website up and running again after more than a week? What an absolute joke. I guess I'll go and find my old Delphi 6 printed language guide to look up the info I can't find online rn.
  5. David Heffernan

    A book about Object Pascal Style Guide

    Sure, if you decide that all things must be called "value", then life is tough. But why make things so difficult?
  6. David Heffernan

    A book about Object Pascal Style Guide

    I have to say that I have never understood why args get prefixed with A and why local variables get prefixed with L. Upper or lower case. I just don't see the benefit.
  7. Nope, you are wrong. There's a window behind that TStrings.
  8. David Heffernan

    Preprocessor

    Writing a pre-processor to handle conditionals should be quite straightforward. I doubt that there exists the pre-processor that you describe.
  9. David Heffernan

    A book about Object Pascal Style Guide

    Collaboration requires somebody to coordinate it, which in this case would need to be the author.
  10. David Heffernan

    Enhanced messageboxes

    No. You just read the Win32 docs and off you go.
  11. David Heffernan

    Enhanced messageboxes

    I have my own functions that call the task dialog api rather than using the VCL component.
  12. David Heffernan

    Enhanced messageboxes

    You don't need a component on a form
  13. David Heffernan

    Enhanced messageboxes

    Isn't this a VCL styles bug? Won't happen with plain windows theme.
  14. David Heffernan

    A book about Object Pascal Style Guide

    Why don't you let us give you extra sets of eyes?
  15. David Heffernan

    A book about Object Pascal Style Guide

    Perhaps I misunderstood the point you were trying to make, but that pattern of returning a newly created instance, with a Free in the except block is useful. Even then the FreeAndNil isn't needed because Result is not seen by the caller.
  16. David Heffernan

    A book about Object Pascal Style Guide

    Not really. The call to LoadFromStream could fail.
  17. David Heffernan

    A book about Object Pascal Style Guide

    Yes there is. I explained what was wrong in my first comment. The try of the try/finally is before the local variable LTextFile is assigned, but it should be immediately after it.
  18. David Heffernan

    A book about Object Pascal Style Guide

    I don't think the issue is complexity, the example is fine. it's just a couple of minor inaccuracies. That said, I'd strip out the FileExists check and just focus on the exception handling: LTextFile := TStringStream.Create; try LTextFile.LoadFromFile(AFileName); Result := TMemoryStream.Create; try Result.LoadFromStream(LTextFile); except FreeAndNil(Result); raise; end; finally LTextFile.Free; end; If you'd like people to comment on the entire book, do ask!
  19. David Heffernan

    A book about Object Pascal Style Guide

    This looks very interesting. After a quick skim of one topic on I note that there's an error on page 89 that is worth addressing. LTextFile is protected by a try/finally but created after the try rather than before the try. In that example I'd also put the try of the try/except immediately after the assignment to Result rather than two lines before it. For what it is worth I'm sure that if you had posted here then quote a few people would have read your book and looked for errors and given feedback. I would happily have done so and would still do so.
  20. vtune with map2pdb is excellent. It will take time to set it up, but it will save you time in the long run. And you'll have a better end result.
  21. Yes. Use a buffered line reader. But more importantly measure where your code spends its time. Don't guess.
  22. David Heffernan

    Showing a warning form to some users

    Sounds like you need to build some messaging infrastructure in to your program.
  23. Regarding the code in the previous post, every call to Delete performs both a copy and a heap allocation. You should be able to do this with one heap allocation and one copy.
  24. David Heffernan

    Using translations in unit Consts with Delphi 10.4 VCL

    Why isn't the function call mapping to the native TaskDialog and so letting the OS provide the captions?
  25. No. There is no problem. If there are multiple threads then the OS will schedule them into different logic processor cores. Always has. You misdiagnosed your problem before.
×