Jump to content

David Heffernan

Members
  • Content Count

    3659
  • Joined

  • Last visited

  • Days Won

    181

Everything posted by David Heffernan

  1. David Heffernan

    Delphi TOIOBE index lifted in May 2022?

    Same as always. Numerical programming. And when there exists huge amounts of code in a language, it can be hard to leave. A phenomenon well known to us Delphi programmers!
  2. David Heffernan

    which JSON library

    Different use cases will suit different libraries. You gave no indication of what your motivations and goals are.
  3. David Heffernan

    "Divided by zero" exception

    Or when calling into a Delphi DLL.
  4. David Heffernan

    "Divided by zero" exception

    That's Embarcadero's fault. They've known how to fix this for at least 10 years, and my patched version of the RTL fixes it. That said, the real issue isn't really a language issue. It's a platform issue. It all stems from the way floating point is implemented on x86 and x86-64 hardware.
  5. Clearly the OP is using short string because the compiler says so. My question is to the OP. Why use short string?
  6. Does it even compile, and if so what does it mean?
  7. David Heffernan

    Type inference in assignment but not comparison??

    Delphi doesn't know that you want [] to be an array rather than a set. Because the language has been designed iteratively and there is ambiguity. Delphi literals are a bit of a mess. In any case are you sure that you want to use = with a reference type? That's reference identity and not value identity. You will need to test for Length(a)=0 or not Assigned(a) or a = nil
  8. David Heffernan

    Only 2 GB available despite IMAGE_FILE_LARGE_ADDRESS_AWARE

    Top down memory allocation, which is what I presume this setting is, was how I found most pointer truncation bugs back in the day. It also broke just about every anti virus software that we tried, until I settled on the MS tool!
  9. David Heffernan

    Only 2 GB available despite IMAGE_FILE_LARGE_ADDRESS_AWARE

    It's just that the reason isn't to do what you did
  10. Please provide a link to this post and if it's wrong then we can correct it. Or perhaps you didn't interpret it correctly.
  11. David Heffernan

    TTaskDialogs not working with Delphi Styles

    Hmm, maybe it's not fixed .....
  12. David Heffernan

    TTaskDialogs not working with Delphi Styles

    Well, good, they fixed that one!
  13. David Heffernan

    TTaskDialogs not working with Delphi Styles

    FWIW this is what I see with Delphi 11.3, and toolbar drop downs. I'm actually at 175% dpi, and running Delphi DPI aware. If I click on the left hand side of the drop down button next to the open icon, I get a file dialog. If I click on the right hand side of the drop down button I get the menu dropped down. I think that the same happens in my app if I use the VCL menu code, although it's so long since I looked that I don't remember the exact details. I'd be interested to know if the latest versions of Delphi IDE manage to handle this drop down hit detection correctly. Other problems I saw with VCL styles drawing menus was failure to scale check marks in high dpi scenarios. I ended up patching Vcl.Menus so that it uses Windows to draw the menus rather than VCL styles which even for the standard Windows theme is what you get for menus. This was gnarly with high DPI because I need to create and cache PARGB32 bitmaps, because that's how you get alpha blended menu icons in system drawn windows: Themed menu’s icons, a complete Vista and XP solution (updated) - nanoANT
  14. David Heffernan

    TTaskDialogs not working with Delphi Styles

    Maybe they fixed it. My experience has been that every time they fix one bug, there's another one around the corner.
  15. David Heffernan

    TTaskDialogs not working with Delphi Styles

    I tried recently and the toolbars still aren't right. Classic example is the behaviour of drop down buttons which open menus in high DPI. Try the file open drop down in, say 250 or 300%. You have to click on the very right hand side of the drop down. Context menus are a mess too. Coming up on the wrong screen. It mostly works, but there's just enough that doesn't for it to be no good. I'd like to offer my clients a dark mode but cannot.
  16. David Heffernan

    TTaskDialogs not working with Delphi Styles

    VCL styles are still not fit for purpose and probably never will be
  17. That's evaluated to a quietnan at compile time, just as it has always been
  18. Ultimately, if exceptions are masked then there's no behavioural difference between SNaN and QNaN. Seems an odd design choice for x86 to change the NaN type though. Presumably there's a reason I'm not aware of. Normally I think I know my way around floating point, but when exceptions are masked is the great unknown for me. I've never been there. And when I explored moving to 12 I just unmasked them!!!
  19. I don't have anything later than 11.3 installed. So there are likely changes that I'm not familiar with. The one thing that jumps to my mind is the ABI. Floating point return values travel via ST(0) in x86 but by a general purpose register in x64 (can't remember which). This means that it has traditionally not been possible to return SNaN by function return value in 32 bit, although it is possible to in 64 bit. That's because loading into ST(0) triggers invalid op. But now fp exceptions are masked by default. Anyway, that's all I know right now, not at a computer.
  20. David Heffernan

    Memory leak on TParallel.For

    I don't know why you don't attempt to debug your code.
  21. David Heffernan

    Unicode Statistics Tool

    You don't need this tool.
  22. The original code looks fine. But you only showed an excerpt. Show a reproduction of an error and then somebody can tell you what is actually going on. Don't fix things until you understand them.
×