Jump to content
Registration disabled at the moment Read more... ×

Leaderboard


Popular Content

Showing content with the highest reputation since 07/22/25 in all areas

  1. Yeah, right 🤦‍♂️ More syntactic sugar, the compiler codegen is still a joke, and we still haven't got SIMD intrinsics. The only time I've ever wished for a ternary operator was when porting C code and being in a rush. But I wouldn't mind all this fluff (since I don't have to use it) - if they would also throw an occasional bone to those of us that need low level performance. Yes, but you don't have to use it.
  2. FWIW I reported the bad inlining due to the way these methods are implemented in TInterlocked and proposed the improvements in https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3862
  3. Hi everyone, I'm excited to share my open-source project: DAOUI Reports, a lightweight visual report designer built with Delphi FMX. It works on both Windows and Android and acts as a simplified alternative to QuickReport, but designed for FireMonkey! 🔹 Features: Drag-and-drop report components (labels, images, shapes, etc.) Data binding with your database fields Preview, Print, and Export to PDF Supports page size customization (A4, etc.) Ideal for mobile reporting 📦 GitHub Repository Any feedback, contributions, or suggestions are more than welcome! Thank you all 🙏 — Daoui Mahmoud.
  4. Great! This is a very long awaited addition for me. I hope they also add a case statement for string types
  5. We have released new updates of all products: Pascal Analyzer 9.17 Pascal Expert 9.17 Pascal Browser 3.5.38 It is possible to download evaluation versions, and also to view the entire documentation online. Go to Peganza for more information. If you are new to the products, we recommend our Youtube video (18 minutes) that describes Pascal Analyzer, with examples and a short demo. These are the changelogs for these updates: Pascal Analyzer 9.17.0 July 15, 2025 fixed an issue with STWA5-"Possible bad pointer usage" improved parsing of constant declarations new section in Warnings Report, WARN64-"Misformed call to Format function" checks if calls have the correct number of arguments and that the types are correct fixed a problem with CONV30-"Private can be changed to strict private" and CONV31-"Protected can be changed to strict protected" fixed issue with WARN46-"Local variables that are set but not later used" WARN3-"Variables that are referenced but never set" does not warn for variables of type TFormatSettings, needs extended analysis to provide accurate warnings fixed an edge-case error that could affect STWA6-"Possible bad typecast" Pascal Expert 9.17.0 July 15, 2025 fixed an issue with STWA5-"Possible bad pointer usage" improved parsing of constant declarations new section in Warnings Report, WARN64-"Misformed call to Format function" checks if calls have the correct number of arguments and that the types are correct fixed a problem with CONV30-"Private can be changed to strict private" and CONV31-"Protected can be changed to strict protected" fixed issue with WARN46-"Local variables that are set but not later used" WARN3-"Variables that are referenced but never set" does not warn for variables of type TFormatSettings, needs extended analysis to provide accurate warnings fixed an edge-case error that could affect STWA6-"Possible bad typecast" Pascal Browser 3.5.38 July 15, 2025 improved parsing of constant declarations
  6. I wonder whether there will be a code formatter that supports this. Given that they deprecated the existing one since Delphi 11, I somehow doubt it.
  7. Actually, a patch was already created for FreePascal to add this very same conditional operator (FPC already had an IfThen() intrinsic); https://forum.lazarus.freepascal.org/index.php/topic,71398.msg556926.html#msg556926
  8. I just noticed this, maybe its interesting https://www.delphipraxis.net/217543-embarcadero-jobportal.html#post1550400
  9. Conditional operator coming in Delphi 13 https://blogs.embarcadero.com/coming-in-rad-studio-13-a-conditional-ternary-operator-for-the-delphi-language/ It is not clear from blog post are both expressions evaluated every time or based on condition? I think is most important thing about this feature.
  10. Visualize complex multi-dimensional data using #TeeBI Composer control. Minimal code, automatic output. https://github.com/Steema/TeeBI/tree/master/demos/delphi/Visualization/Composer
  11. Vincent Parrett

    Need help investigating an app crash

    I would try using MadExcept or Eurekalog for capturing unhandled exceptions - in my experience they produce far more reliable and useful information than JCL.
  12. On this atleast syuntax is readable X := if Left < 100 then 22 else 45; For example C-syntax is not what I really can say that I like. int result = (x > 5) ? 10 : 20; even worse if writte like this int result=(x>5)?10:20; Syntax highlighting saves a bit for sure but still easy to miss those... One character operator thingies... -Tee-
  13. Wow, I hated the ternary operator in every language I encountered so far. But this one with pascal keywords seems almost bearable. But, I'm sure it will bring all sorts of new anti-patterns to Delphi. And I don't think a language saddled with 'with' needs any more anti-patterns.
  14. Anders Melander

    if Obj <> nil then Obj.Free

    Delphi 1 ; procedure TObject.Free ObjectFree: MOV BX,SP LES DI,SS:[BX+4] MOV AX,ES OR AX,DI JE @@1 MOV AL,1 PUSH AX PUSH ES PUSH DI LES DI,ES:[DI] CALL ES:[DI].vtDestroy @@1: RETF 4 Delphi 2 procedure TObject.Free; asm TEST EAX,EAX JE @@exit MOV ECX,[EAX] MOV DL,1 CALL dword ptr [ECX].vtDestroy @@exit: end;
  15. devlopnew

    Project: Daoui Reports What Is It?

    Project: Daoui Reports 🧩 What Is It? Daoui Reports is a dynamic report generator developed using Delphi FireMonkey (FMX), designed to create visually rich, data-driven reports for both Windows and Android platforms. It is a lightweight, open-source alternative to commercial reporting tools like QuickReport or FastReport, offering a simple yet powerful way to design and generate printable or exportable reports directly from SQLite databases. ✅ Key Features Visual Design: Drag-and-drop components (Text, Labels, Images) onto a report template, just like in QuickReport. 🔁 Dynamic Data Binding Connects to a TFDQuery and repeats the Detail section for each record in the dataset. 📄 Automatic Page Breaking Splits content across multiple pages when it exceeds the page height, using IntersectsWith logic. 📸 Screenshot-Based Rendering Uses MakeScreenshot to capture the visual state of each Detail block and render it as an image in the final report. 🖨️ Preview & Print Offers a preview window with zoom and page navigation. Supports direct printing on Android via PrintBitmap 📎 PDF Export (Android) Exports the final report to PDF using Android’s JPdfDocument API. 📱 Cross-Platform Built with FireMonkey for full compatibility with Windows and Android . 💡 No External Dependencies Relies only on native Delphi components and FireDAC—no third-party libraries required. 🏗️ How It Works Design Mode You place visual components (like TText, TLabel) inside a TLayout called Detail. This acts as the template for each data row. Data Binding A TFDQuery is linked to your SQLite database. When the report runs, it loops through each record. Dynamic Height Calculation For each field (especially multi-line text), the system calculates the required height using TTextLayout to ensure text wraps correctly. Page Generation Each record is rendered into the Detail layout. A MakeScreenshot captures its visual state. The image is placed in a TRectangle within ZoneDetail. When the content reaches the bottom of the page (checked via BoundsRect.IntersectsWith), a new page is created. Preview & Output All generated pages are displayed in PreviewF.LayoutZOM as TImage components. From there, users can: Zoom in/out Navigate pages Print Export to PDF (on Android) 📁 Core Units UnitMain.pas Main form with SQL input, data grid, and report settings (show/hide sections). DesignU.pas The engine of the report. Contains DESINGFACT , the core function that generates the report dynamically. PreviewU.pas Handles preview, printing, and PDF export . Manages the display of all report pages. 🎯 Why Use Daoui Reports? Simple & Fast: No complex setup—just design and run. Open & Transparent: Full access to source code for customization. Mobile-Ready: Works seamlessly on Android devices. SQLite-Friendly: Ideal for local database apps. Lightweight: No bloated dependencies or installer packages. 🚀 Ideal For Inventory reports Sales summaries Fish species catalogs (as in the demo) Any application needing simple, printable reports without licensing costs. 💬 In Summary Daoui Reports is a practical, no-frills reporting solution for Delphi developers who want full control over report design and output—without relying on expensive or complex third-party tools. It proves that with smart use of MakeScreenshot, FireMonkey, and FireDAC, you can build a robust reporting system entirely in Delphi. 🔗 GitHub: https://github.com/devlop0/daoui-reports
  16. Rollo62

    Anonymous instance methods

    Yes, thats nice and useful, you can also extend this a bit, to avoid dangling pointers. See these rough ideas ... destructor TAnonProc.Destroy; begin if (Owner is TButton) and (TMethod(TButton(Owner).OnClick).Data = Self) then begin TButton( Owner ).OnClick := nil; // Ensure to remove dangling Pointer end; inherited; end; or you could even separate the Owner from the Observer type TAnonProc = class(TComponent) private FProc: TProc<TObject>; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure OnSender(Sender: TObject); public constructor Create(AOwner, AObserved: TComponent; AProc: TProc<TObject>); end; constructor TAnonProc.Create(AOwner, AObserved: TComponent; AProc: TProc<TObject>); begin inherited Create(AOwner); // Owner = Form FProc := AProc; AObserved.FreeNotification(Self); // register observer if AObserved is TButton then TButton(AObserved).OnClick := OnSender; end; procedure TAnonProc.Notification(AComponent: TComponent; Operation: TOperation); begin if (Operation = opRemove) and (AComponent is TButton) then begin TButton(AComponent).OnClick := nil; // Clear the Pointer end; inherited; end; procedure TAnonProc.OnSender(Sender: TObject); begin if Assigned(FProc) then FProc(Sender); end; //.......................... TAnonProc.Create(Self, Button1, procedure(Sender: TObject) begin Caption := 'Click!'; end);
  17. Angus Robertson

    if Obj <> nil then Obj.Free

    In general, ICS does use FreeAndNil for new code, if not nilled in code, the nil being the important part, since double Free without nil does cause an exception. Double free is common, due to the complex inheritance of many ICS components. But I simply don't have the time to clean up code written up to 25 years ago, unless I'm updating that code for other reasons. It all needs testing afterwards, and often correction when it then fails to compile on older versions of Delphi... Angus
  18. Demo source code: https://github.com/Steema/TeeBI/tree/master/demos/delphi/Geographic/USA_Counties Note: This demo needs the "Pro" version of TeeChart.
  19. dummzeuch

    Any way a proc can find out its calling proc?

    There is always the return address on the stack. Which you can get by calling ReturnAddress But I guess you don't want an address but a function / method name? JclDebug offers some functions for that: https://stackoverflow.com/questions/1301254/how-to-get-current-methods-name-in-delphi-7 Or as described here:
  20. Anders Melander

    Calling routines overhead

    Profile it. The significance of the overhead really depends on what the routine is doing and how often it is called. For example if the call overhead is X but the routine itself takes 1000*X to execute then the overhead is insignificant. Apart from the overhead of the call itself there's the overhead of passing parameters. You need to learn how parameters are passed in order to optimize them. Not all parameter types can be passed in registers, Delphi doesn't use all available registers, 32-bit and 64-bit does things differently, etc. Also be aware that if you pass literal floating point numbers as parameters, the compiler might not consider the literal values to be the same type as the parameter which means that it will produce code to convert the values to the correct type. For example, if the parameter type is Single and you need to pass 0.5, then pass it as Single(0.5) - or declare a typed constant with the value and pass that. Set Code Inlining Control=Auto to have the compiler automatically inline small routines. With regard to writing stuff in assembler be aware that assembler routines can't be inlined so the call overhead becomes mandatory. For example, in my code one constant bottleneck is calls to Round and Trunc. I have assembler versions of these two functions which are much faster but unfortunately the call overhead completely eliminate the performance gain so they are basically useless. It's beyond me why Delphi doesn't implement these two as intrinsics. They are listed as such but they are implemented as regular functions. Not only that, but the Pascal version will provide a reference implementation to test and benchmark against and it will help documenting what the assembler versions does.
  21. Anders Melander

    Minimum Viable Product (MVP)

    *facepalm*
  22. In the example thay gave, the equivalent expression is a typical IF, so we can deduce that the new expression also behaves in this way: the part not affected by the condition will not be evaluated. Of course, only they or the release can confirm this.
  23. @@AT I still think you don't understand the function of Interlocked and how it works. Even in your example, you use loops to verify that the function "succeeds." This is legal if the variables are modified by other threads and you enter that "loop" indefinitely until the variables assume an identical value to exit. But since you also mention collisions, I think you actually believe that Interlocks are executed or not based on collisions. That's not the case. It's not a mutex or a semaphore, and it's not a critical section. Interlocked simply protects a memory area from "concurrent" modifications. And note that in reality, most direct memory operations are already intrinsically protected. For example, INTEL guarantees the atomicity of some operations such as direct reading or writing, which involves a register and "byte," word, dword, etc. memory if the memory is aligned. XCHG instructions are also atomic (unlike complex instructions like CMPXCHG) as long as they operate on aligned memory. LOCK can be used on multiple memory-operating instructions to ensure LOCK even in unintended cases (e.g., unaligned memory). Ref: "Intel® 64 and IA-32 Architectures Optimization Reference Manual: Volume 1, April 2024"; Ref: "Intel® 64 and IA-32 Architectures Software Developer’s Manual, March 2025" Caution: Interlocked functions generate a significant delay in instruction execution (i.e., the instruction executes in more clock cycles than normal).
  24. Dalija Prasnikar

    What is the best AI at Delphi

    We are no magicians. We cannot create code which does not exist. There is simply not enough Delphi code around for AI training. It is easy to have good coverage for JavaScript and similar where you literally have bazillion web pages available for scraping, where plenty of them virtually repeat the most common, required functionality. Pushing for more publicly available code without considering its quality, can also backfire. What we need is better non-AI code completion. If you need to generate larger chunks, then you don't have to do that directly within the IDE. Also you can easily use some other editor, like VSCode to give AI access to context and generating code, and then simply reload changed files in IDE. This works fine in both ways. This is not a showstopper. Ditching VCL would be the most stupid idea ever. It would be suicidal. There are huge amounts of code out there that use VCL, and moving all those to FMX would be impossible. And this is not just about old code, people use VCL for writing new code, too. Because they already have all the other infrastructure built around VCL. I am certainly not going to start new Windows application based on FMX, unless I really need some of its features. What could help this transition would be restructuring VCL and FMX to use common Application layer which would enable mixing VCL and FMX frameworks in the same application. However, this is also something that is not very likely to happen as both frameworks are rather mature at this point and such restructuring could have impact on backward compatibility. Maybe having support for multiple helpers in scope and opening up private parts of VCL and FMX allowing more customizations from the ground up could help in such transition. But this would be long term and slow process.
  25. see also: delphi - XE4: How to change exe output name base on platform? - Stack Overflow
×