Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. I sometimes wish I could call Delphi code in SQL style. Run(aText2='my text'); i.e. specify individual parameter(s) and leave the rest as their default.
  2. I was working with various kinds of financial data, weather data and power data (prices, volumes, etc), and thousand separators usage was variable. Spaces, commas, dots, the lot. It was a hodge-podge of formats since very few standard exchange formats existed at the time. Even vendors that you had contractual agreements with, would change the format on the fly, without notice. "Yeah, we changed the format. Nobody told you?"
  3. The common trait is that both floats and dates have separator character challenges. For floats, the only reliable solution is to KNOW the input format and do the necessary stripping/replacement before passing the string to the converter. In some of my older input parsers, I stripped spaces, then checked for the presence of , and . and did the following processing - if only one exists, don't touch it - if more than one of a kind exists, remove them all - if both exists - remove all but the last one Which still is hopeless if the 1,000 is 1000 and not 1 with three decimals.
  4. Lars Fosdal

    10.4.1+ Custom Managed Records usable?

    I am still waiting for nullable types so that I can rewrite more code 😛
  5. Lars Fosdal

    Page1.MirrorMode

    This may be because 10.4 has introduced "MirrorMode" and you changed/saved the form in 10.4. If "MirrorMode" does not exist in 10.3, you would get that kind of error. But - why would you switch back and forth between versions for the same forms? The only safe way is to stick with the latest version you have access to.
  6. These things are perpetual headaches, as is the time and date separators. The default Norwegian Windows language setting is using period for both, which confuses the hell out of the Delphi string to datetime decoders.
  7. We need a truly immutable typed const.
  8. @Fr0sT.Brutal - Same for records. {$WRITEABLECONST OFF} const TypedConst: xlt = (no:'Norsk'; se: 'Svensk'; en:'English'); type pxlt = ^xlt; procedure TForm1.TestTypedConst; procedure Show(const aConst: xlt); begin Memo1.Lines.Add(aConst.no +', '+ aConst.se +', '+ aConst.en); end; begin Show(TypedConst); pxlt(@TypedConst)^.se := 'Deutsch'; Show(TypedConst); end; Output Norsk, Svensk, English Norsk, Deutsch, English So, the answer is a definitive no. Edit: Note that with WRITEABLECONST OFF TypedConst.se := 'Deutsch'; gives a [dcc32 Error]: E2064 Left side cannot be assigned to while it compiles with WRITEABLECONST ON.
  9. That last point would a major concern. Source code is necessary for third party libs. Are they wrapping some DLL or ActiveX class that is shared across the supported platforms?
  10. I've butted my head against this, and sadly there currently is no way to pass a typed const to an attribute. There are reports for problems with typed consts - so please vote. https://quality.embarcadero.com/browse/RSP-13921 likewise, for dynamic arrays https://quality.embarcadero.com/browse/RSP-32488
  11. https://www.nsoftware.com/ipworks/iot/ supports AMQP 1.0 and 0.9.1 Doc for Delphi: https://cdn.nsoftware.com/help/IOF/dlp/ I haven't tried it. @jeroenp - Did you find a AMQP 1.0 compatible lib elsewhere?
  12. Lars Fosdal

    TJSONObject.Format bug

    That sounds likely. I stumbled on similar problems with formatting of json strings in other languages when I googled.
  13. Lars Fosdal

    TJSONObject.Format bug

    Not sure why it would barf on %, but you can replace % with \u0025 (Unicode escape) See also https://stackoverflow.com/questions/19176024/how-to-escape-special-characters-in-building-a-json-string/27516892 What happens if you put a double %% or %25 (Similar to \u0025) or \%
  14. Lars Fosdal

    TListView filled by Thread = Freeze

    I usually do this as a two pass operation. I first start a thread that fills a memory structure. Once the thread is done, I trigger an update in the main thread that fills the UI from the memory structure. I have nothing but negative experiences with doing UI updates directly from threads.
  15. Your English is fine. Most of the APIs we use, require OAuth 2.0, hence my question.
  16. Lars Fosdal

    AllocHwnd + TTimer = lag?

    That is waaay to familiar. As a developer, you never run out of chances to own yourself.
  17. Lars Fosdal

    AllocHwnd + TTimer = lag?

    I've had issues with having multiple allocated hWnds and messaging. Ended up with a single allocated hWnd and a custom message broker/router for my user messages.
  18. Lars Fosdal

    Delphi 11 Announced

    https://blogs.embarcadero.com/rad-studio-11-is-coming-new-version-announcement-and-beta-invite-for-update-subscription-customers/
  19. Lars Fosdal

    Delphi 64 bit Registration Tools for Windows Apps

    A company that offers registration tools i.e. licensing tools for developers?
  20. Lars Fosdal

    Drawing bug with VCL Styles

    Still unable to reproduce (10.4.2).
  21. Lars Fosdal

    Alfabetical order of a letter

    A-Z. AA-ZZ, AAA-ZZZ
  22. Assuming the Tag value of each checkbox can be set to the ordinal of it's enum, you could walk the enums and check if you find a checkbox under Filters for each of them. If you don't find it - you change the caption of "Filters: to "Filters is INCOMPLETE" or log it or whatever. But - it would be runtime, preferably in the debug code. Likewise, you could easily take a set of enum values to get or set the states of the check boxes. It is a little inconvenient to do this in Generics, since we don't have a constraint for enumerated types - which means we can't really use Low, High or Ord, but it is possible.
  23. Lars Fosdal

    Create hyperlink inside code

    Very thin description. Are we talking design time in source code?
  24. Link rot - the scourge of the internet 😛
×