Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/08/21 in all areas

  1. Isn't fastest and using Delphi's own classes mutually exclusive? My personal recommendation goes to https://github.com/ahausladen/JsonDataObjects
  2. Uwe Raabe

    Using Attributes in class declarations

    Very good point 👍
  3. If the file is large enough to exceed available memory, probably you'll want to use stream-like parser, like SAX from XML. Grijjy has something alike https://blog.grijjy.com/2017/01/30/efficient-and-easy-to-use-json-and-bson-library/
  4. Lars Fosdal

    Using Attributes in class declarations

    I see that I've cut off the source I pasted. If you had the full source, you would have seen that the numbers are the default widths in pixels. This is the initial default value. I.e. those you need before you have a config to load. The same default as you would define in a constructor or design in the form editor. Likewise, with the type of the field, there is a default alignment which can be overridden with the attribute. These are indeed presentation properties and they are defaults explicitly bound to each instance of a field. The idea is to keep the default properties together with the field declarations instead of having them spread out through the code or defined in the .dfm. Unfortunately, I cannot use record constants to initialize the titles or specify the secondary sorting columns due to limitations in the language.
×