Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/25/24 in Posts

  1. Uwe Raabe

    File extension icons all gone with D12.2

    Tools > Options > IDE > File Association
  2. CmonLib Initializing provides a way to register a procedure to be called during Application.Initialize. This allows to make adjustments before (f.i. in the dpr file or some units), which would be near to impossible if the initialize code would execute in the units initialization section.
  3. FreeDelphiPascal

    Delphi roadmap 2024

    If it is not bullsh*t (obviously a road map cannot be legal binding especially when they have a "safe harbor" section), then it is sad. Very sad. 😞
  4. Uwe Raabe

    Work-around for TEdit vertical alignment problem

    As long as it is a native Windows control, we are limited by its internal functionality. Currently it doesn't support that: Edit Control Styles
  5. Yeah, my interpretation was wrong. It doesn't exactly makes the connection (or disconnection) between the class constructor and the initialization section. The exact quote is: "Note that a class constructor only executes if the class is used. So unlike a normal initialization section of a unit (which always executes), it only executes if the class is used somewhere." Yesterday I was reading more about class conductors, and I see his statement in a new light. I think, to this point, the https://blog.therealoracleatdelphi.com/2009/09/ is still the best resource available about class constructors. https://stackoverflow.com/questions/39471864/delphi-constructor-and-class-constructor
  6. Uwe Raabe

    Correct transition from dcc32.exe to MSBuild.exe.

    Usually it is sufficient to call the rsvars.bat of the required version: call "c:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat"
  7. Anders Melander

    Only 2 GB available despite IMAGE_FILE_LARGE_ADDRESS_AWARE

    <Also known as throwing sh*t at a wall>
  8. Lajos JuhĂĄsz

    TParallelArray Sort Performance...

    Stefan you should give at least 48 hours to a new version before you break it. It does handle array of 100_000 integers. Maybe for a larger arrays you have to buy a special SKU for sorting.
  9. Dalija Prasnikar

    Dynamic array used as a queue. Memory fragmentation?

    If you are frequently adding/removing items from array and the maximal occupied memory is not an issue, I would use TList<T> instead of dynamic array which supports Capacity. Set the Capacity to the maximum number of elements you are expecting (if there are more underlying dynamic array will automatically grow). That will prevent frequent allocations/deallocations and improve performance. You may also use TQueue<T> which might be fit for your needs. Whole array needs to be allocated in one place so there will be no memory fragmentation just because of that array reallocations.
  10. David Heffernan

    "for i in" goes in reverse

    Code editors telling you stuff is great but the bigger problem is the missing functionality at the fundamental language level.
  11. Uwe Raabe

    "for i in" goes in reverse

    A workaround would be to declare the array as a constant or create a dynamic array on the fly: for I in TArray<Integer>.Create(45, 30, 15) do
  12. Dave Nottage

    "for i in" goes in reverse

    Please keep the profanity out. Delphi treats the constant in that statement as a set. See this.
  13. From an old blog post from Allen Bauer (https://blog.therealoracleatdelphi.com/2009/09/: " All eligible class constructors and class destructors are invoked in sequence with unit initialization and finalization, respectively. If a given class constructor or destructor is eligible to be invoked (ie. it was linked into your application), it will run immediately before the initialization section for the unit in which the class is implemented. The class destructors will be invoked immediately after the finalization section for the unit in which the class is implemented. Class constructors in a given unit are generally invoked in the same order of declaration, except in cases described below. Class destructors are invoked in reverse order from the class constructors. For an ancestor class declared in the same unit, its class constructor will be invoked before the descendant class constructor and the class destructor is invoked after the descendant class destructor. If the implementation of given class constructor references another class in the same unit with a class constructor, the referenced class’ class constructor will be invoked before the current class’ class constructor. If the references are cyclic (ie. they reference each other in their class constructors), then they are invoked in reverse order of declaration. This means that there can be cases where a class constructor can reference an “unconstructed” class. Ancestor classes from external units used in the interface section are guaranteed to already have their class constructors run prior to any class constructors on descendant classes within the current unit. Unit cycles can break down the deterministic nature of the above rules in the same manner as unit initialization and finalization. However, for a given unit, it is guaranteed that all the class constructors declared within in it will have already run immediately before the initialization section runs. Congruent to this rule is that it is guaranteed that all the class destructors will run immediately after the finalization section. Dynamically loaded packages, using LoadPackage. Because there is no way to know exactly which classes are going to be used, just like there is no way to know which units are going to be used, all class constructors and destructors along with all unit initialization and finalizations are invoked according to the above rules. Other rules about their use are: You do not have to declare a class destructor if you declare a class constructor, and vice versa. They cannot be virtual, dynamic or message. They cannot be explicitly called. They cannot have any parameters. They do not have to be called Create and Destroy. (ie. Init and Fini are equally valid names). With this implementation, it was easier to leverage the same table that the compiler creates for unit initialization and finalization. It satisfies this requirement: “Called automatically to initialize the class before the first instance is created or any static members are referenced.” Issues with cycles are also clearly warned against in VB.NET and C#: “Avoid circular references in Shared 
 since it is generally impossible to determine the order in which classes containing such references are loaded.” Another benefit is that since it is running during the initialization/finalization phases, any threading implications are no different than the existing rules regarding unit initialization and finalization." What we don't know is, if the compiler behavoiur has changed since then.
  14. Circular references create a lot of fun.
  15. cupboy

    Migrating Delphi to new device

    And check out what the other sales guy said: Thank you for reaching out! Unfortunately, both serial keys have not been on active maintenance for more than 365 days. You cannot renew the same licenses or increase the registration limits. Warm Regards, Faraz Khattak Customer Renewals Representative E: faraz.khattak@idera.com
×