Leaderboard
Popular Content
Showing content with the highest reputation since 07/23/25 in Posts
-
A Conditional Ternary Operator for the Delphi
Anders Melander replied to EugeneK's topic in RTL and Delphi Object Pascal
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. -
Are TInterlocked.Exchange and CompareExchange implementation really Atomic with class types??
Stefan Glienke replied to @AT's topic in RTL and Delphi Object Pascal
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 -
🚀 [Open Source] DAOUI Reports – A Visual Report Designer for FireMonkey (Windows & Android)
devlopnew posted a topic in FMX
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. -
A Conditional Ternary Operator for the Delphi
Kryvich replied to EugeneK's topic in RTL and Delphi Object Pascal
Great! This is a very long awaited addition for me. I hope they also add a case statement for string types -
ANN: July Updates for Pascal Analyzer, Pascal Expert and Pascal Browser
Peganza posted a topic in Delphi Third-Party
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 -
A Conditional Ternary Operator for the Delphi
dummzeuch replied to EugeneK's topic in RTL and Delphi Object Pascal
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. -
A Conditional Ternary Operator for the Delphi
Remy Lebeau replied to EugeneK's topic in RTL and Delphi Object Pascal
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 -
Delphi Developer Job Offer (Germany) / Delphi entwickler
Rollo62 replied to NR2024's topic in Job Opportunities / Coder for Hire
I just noticed this, maybe its interesting https://www.delphipraxis.net/217543-embarcadero-jobportal.html#post1550400 -
A Conditional Ternary Operator for the Delphi
EugeneK posted a topic in RTL and Delphi Object Pascal
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. -
A Conditional Ternary Operator for the Delphi
Tommi Prami replied to EugeneK's topic in RTL and Delphi Object Pascal
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- -
A Conditional Ternary Operator for the Delphi
omnibrain replied to EugeneK's topic in RTL and Delphi Object Pascal
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. -
if Obj <> nil then Obj.Free
Anders Melander replied to EugeneK's topic in ICS - Internet Component Suite
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; -
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
-
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);
-
if Obj <> nil then Obj.Free
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
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 -
Demo source code: https://github.com/Steema/TeeBI/tree/master/demos/delphi/Geographic/USA_Counties Note: This demo needs the "Pro" version of TeeChart.
-
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:
-
*facepalm*
-
A Conditional Ternary Operator for the Delphi
Remy Lebeau replied to EugeneK's topic in RTL and Delphi Object Pascal
I didn't say it was *submitted* for merge into FPC. I said it was *created*. There is a patch file attached to the forum post that I linked to: "It's roughly 30 lines of code and took 15 minutes to create the attached patch for fpc main" -
Are TInterlocked.Exchange and CompareExchange implementation really Atomic with class types??
DelphiUdIT replied to @AT's topic in RTL and Delphi Object Pascal
@@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). -
Nearest I have seen is https://github.com/HemulGM/FMXRichMemo
-
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.
-
wuppdi Welcome Page for Delphi 11 Alexandria?
gkobler replied to PeterPanettone's topic in Delphi IDE and APIs
New Version is available. V 1.2.1.B42 for x86 and x64 D12.x Now you can adjust the behavior -
What new features would you like to see in Delphi 13?
gioma replied to PeterPanettone's topic in Delphi IDE and APIs
I wish the IDE would work! - I wish word searches would not crash the IDE and cause my unsaved work to be lost. - I wish the IDE would not freeze for no apparent reason and cause my work to be lost - I wish Code Insight would finally work - I wish the IDE would not go out of memory after using it for a while To sum up: I want a stable IDE that doesn't waste my time and finally fixes the bugs that have been around for years! am I asking too much? -
How to enable SafeSEH, CFG flags for Delphi 10.4 Dll's/Exe's?
Anders Melander replied to raj_delphi's topic in General Help
Nah nah nah nah, can't hear you. I just added support for Alpha AXP to my application with SetPEFlags(IMAGE_FILE_MACHINE_ALPHA). Neat huh?