Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. Combine can mean many things. Realistically though, if you want to do programming, you can't avoid gaining the skills necessary.
  2. David Heffernan

    docwiki.embarcadero.com is not working

    I can't see a joke here. Maybe I should just mute the topic because there is nothing more to say.
  3. David Heffernan

    docwiki.embarcadero.com is not working

    It isn't the case. Why are you speculating on something about which you have zero information?
  4. David Heffernan

    Is a "bare-minimum" EurekaLog possible?

    No doubt I can get the information about the nested exceptions using ME code. I solved my problem a different way that was actually a bit more elegant and avoided the complexity of nested exceptions anyway.
  5. David Heffernan

    Generic sort of several "parallel" arrays?

    Is this telling you is that your data structure is wrong? What you need is a record with the 4 values and then array of that record. Then basic array sort with custom comparer gets it done. Then again, perhaps you so need direct access to contiguous arrays of each of the 4 scalars. As stated you really need a sort algo that allows you to provide both comparer and exchanger. I had such a thing once. The final approach is not to modify the arrays at all. Create an integer array with values from 0 to N-1 and then sort that using the x values to determine the order. Have the compare function return CompareSingle(x[idx[left], x[idx[right]])
  6. David Heffernan

    Is a "bare-minimum" EurekaLog possible?

    In Pascal code Exception.InnerException is never assigned.
  7. 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 .....
  8. 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"
  9. David Heffernan

    docwiki.embarcadero.com is not working

    Perhaps they don't know it's broken?
  10. 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.
  11. 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?
  12. 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.
  13. Nope, you are wrong. There's a window behind that TStrings.
  14. 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.
  15. 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.
  16. David Heffernan

    Enhanced messageboxes

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

    Enhanced messageboxes

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

    Enhanced messageboxes

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

    Enhanced messageboxes

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

    A book about Object Pascal Style Guide

    Why don't you let us give you extra sets of eyes?
  21. 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.
  22. David Heffernan

    A book about Object Pascal Style Guide

    Not really. The call to LoadFromStream could fail.
  23. 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.
  24. 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!
  25. 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.
×