Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 11/24/24 in all areas

  1. Anders Melander

    Open-source Delphi interpreters?

    I have used DWScript as a scripting system in several products. Used either to provide business rules (no UI, just logic) or as a app/plugin (with UI). The OP language support and performance is excellent. The learning curve is extremely high (no documentation, few examples). Here's an IDE/debugger I wrote for it: DWScriptStudio FWIW, https://www.beginend.net is powered by DWScript.
  2. pmcgee

    The Advent of Code 2024.

    The Advent of Code 2024. ChatGPT >> I’d like to encourage lots of Delphi people to have a crack and maybe compare solutions - online or at a meeting. Each day is pretty much independent of the others … but the concepts might build upon previous days’ puzzles. Fun starts on 1st December. Link → The Advent of Code 2024
  3. Stefan Glienke

    Strict type checking for tObject.

    It is pretty simple - imagine if the code below would work that way: procedure ReplacePet(var pet: TPet); begin pet.Free; pet := TCat.Create; end; procedure Main; var dog: TDog; begin ReplacePet(dog); dog.Bark; // meow?! end; FreeAndNil is special because it just destroys and assigns nil. But a var parameter does not give that guarantee.
  4. Prior to Delphi 12, the Enum type for TShiftState is anonymous, so you can't declare a variable of that type, at least not directly. With the introduction of Inline Variables and Type Inference in Delphi 10.3, you can do so, but only if you initialize the variable at the same time you declare it, eg: var state := ssShift; This is exactly the kind of situation why several such Sets in the RTL have been re-written in recent versions to separate their Enum types from their Set types. TShiftState was re-written in Delphi 12, it now looks like this: TShiftStateItem = (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble, ssTouch, ssPen, ssCommand, ssHorizontal); TShiftState = set of TShiftStateItem; So, you can now declare a variable of type TShiftStateItem.
  5. Delphi YouTube Downloader This project is a YouTube downloader developed in Delphi capable of downloading videos in various formats and qualities. Supported Formats Video Quality: From 8K to 360p in MP4 format. Audio Formats: MP3, FLAC, and M4A. Requirements yt-dlp and ffmpeg are used as open-source libraries for downloading and processing media files. Installation Instructions Ensure that the following files are present in the Tools folder: ffmpeg.exe yt-dlp.exe Download location: Videos will be saved in the Downloads folder located in the same directory as the application. Feel free to contribute and improve the project! Your contributions are welcome. 👍 🚀 https://github.com/mesutde/Delphi-Youtube-Downloader
  6. Remy Lebeau

    Strict type checking for tObject.

    Perhaps this will help: Magic behind FreeAndNil
  7. tinyBigGAMES

    Some new projects...

    What if you wanted an even smaller Lua integration for Delphi? Just using stock Lua 5.4.7+, statically linked directly into your Delphi executable with no external overhead, and automatic registration of native Delphi routines, all in a single unit? Introducing Chandra - Lua Scripting for Delphi. A client needed a tiny, simpler, but capable Lua scripting solution than my recently released PLUA. The Chandra.o file (just Lua compiled into a single translation unit) is linked directly into Delphi via {$L Chandra.o} with ~600kb overhead. It can directly register published Delphi class methods via RTTI. Enjoy, happy coding! 👀 https://github.com/tinyBigGAMES/Chandra
  8. Darian Miller

    Open-source Delphi interpreters?

    This is probably the better choice: https://www.delphitools.info/dwscript/
  9. Dalija Prasnikar

    Strict type checking for tObject.

    Another more elaborate example that will show why is compiler strictness for var parameter necessary, and why without it we could easily and unintentionally write the code that can corrupt memory otherwise Pass the Dog, Get the Cat
  10. You're better off doing something like function myfunc(const InVal: String; out OutVal: Double): Boolean; Return True if the value was set and false if not. There are other ways to handle this but the worst way is a magic value in Double. There's no reason to do that when it is so easy to indicate explicitly whether or not the value is valid.
  11. Hi All 40% off on new licenses until midnight 4th December - no need for a coupon, the discount will be applied automatically. We have opened up sales on our code/document signing server Signotaur - although the actual release is not until next week the release canidate is available for download. https://www.finalbuilder.com/store
  12. AntoineGS

    Vim Keybindings?

    So I am replying to an old post as this thread comes up high on Google when looking for Vi(m) keybindings in Delphi. Since the projects posted by @DelphiUdIT were abandoned I have forked the latest and rewritten a lot of it to extend its functionality. So if anyone ends up here you can use Vi4D to get a lot of the bindings working. This with the newly merged Relative Line Numbers in CnWizards gives a pretty good combination. PS: There is no support for C++ Builder at this time but it might be possible by building to a DLL and installing that instead of the BPL. If someone shows interest I will take a look at it.
  13. David Heffernan

    Backward compability

    I don't think your expectations are reasonable. You can't expect to mix and match Delphi versions like this. When you are ready to upgrade, do it in a coordinated and unified manner.
  14. Rollo62

    Buying a mini pc to install Delphi

    I'm using Parallels too, because at those days, VmWare Fusion was year behind and unsure to support Apple Silicon at all, while Parallels was way ahead and went clearly all-in. This forced me to move from my beloved VmWare to Parallels, and nowadays I would say that Parallels still is a step ahead, even if VmWare might get closer. The unclear strategy of VmWare at the time, and even today with Broadcom as their latest owner, I'm distracted enough that I haven't touched it for a while. No problems with Parallels so far.
  15. Save 25% on new registrations with coupon code BF2024! The latest version, DocInsight 2025 Insiders (Version 6.0.0.19), was released on November 24, 2025. DocInsight 2025 Release Notes (Draft) Download
  16. Jim McKeeth

    Why does IDE require UAC elevation when starting?

    I would be concerned... This sounds like you have something else causing trouble. It could be an indication of some corruption in your installation, or some other software that is causing the trouble. If things are working then no need to mess with it, but I would recommend using this as motivation to make sure you have a good backups of your data, so you will be ready if you need to create a fresh Windows install sometime soon.
  17. Alexander Sviridenkov

    ANN: HTMl Library 4.9 released. WebUI and more

    New video - 3D in WebUI
  18. Stefan Glienke

    chatgpt can convert 32bit asm into 64bit

    Converting source code that won any challenge over 15 years ago is questionable regardless of correctness. Anyway, for this particular example, implementing a faster System.Move for Windows (other platforms use their libc memory) has been solved since Delphi 11.3. I sincerely challenge everyone to come up with a faster/better implementation.
  19. Hi, I just got an email from Appercept (https://www.appercept.com) offering a 20% black friday deal on the Appercept AWS SDK for Delphi - for anyone interested in utilising services on Amazon Web Services. A coupon BLACKCYBER20 just needs to be applied on checkout it seems. I have it from through the Emb Enterprise edition, but it may be useful for anyone on Pro that wants access to a very good SDK. IMO It has excellent documentation, responsive support and continuous development!
  20. Some Windows users received a faulty Windows update with WebView2 Runtime 131 that broke the official way to check if the evergreen runtime is installed in the computer. Microsoft stopped the deployment of that update and then released a fix but some computers may still have the broken runtime. In the case of WebView4Delphi this update caused the GlobalWebView2Loader.StartWebView2 call to return false because it couldn't find the WebView2 runtime on the system. As a temporary workaround, set GlobalWebView2Loader.CheckFiles to FALSE before the GlobalWebView2Loader.StartWebView2 call. Read this issue in the feedback repository for more details.
  21. Very good suggestion by @dummzeuch Very few people give enough thought to naming of functions and variables. Developing a consistent approach can significantly help with long term program readability / long term support for large projects. Anything that hints at doing that gets my full support ! https://cigolblog.wordpress.com/2023/01/ https://cigolblog.wordpress.com/2019/10/ https://cigolblog.wordpress.com/2017/06/
  22. I usually prefix functions like this with "Try", so instead of function GetTheValue(parameters ...): SomeType; it's function TryGetTheValue(parameters ...; out Value: SomeType): Boolean;
  23. No, because the parameterless TObjectList<T> constructor sets OwnsObjects to True. And that is nothing new but also already was the case in the old TObjectList from Contnrs.pas I am glad I can use Spring4D and have several flavors of multimaps at my disposal
  24. You always can use a TObjectDictionary<String, TObjectList<TMyClass>>. That way you can have multiple instances of TMyClass assigned to the same string key.
  25. Stefan Glienke

    Micro optimization: IN vs OR vs CASE

    The point that others already have expressed is that despite being interested in a topic as performance improvement so low level (as in instruction-level instead of algorithmic level) you seem to lack some important knowledge to do so such as assembly - it does not require as much as it does to write assembly code but to understand it in order to be able to look at the code in the debugger and see that some comparisons are apples and bananas. I did not even read through your code but simply placed a breakpoint into your IsIN function and noticed that it contained a function call to System.SetElem (that even was the first time I have ever seen that function being called so a TIL for me). Why was that the case? Because you are not using consts here but variables. Had you simply made consts for all those IDs the code would have almost as fast as the IsOR which does not suffer to extra function calls but from memory reads (not noticeable in the benchmark because its all in L1 cache already). On my CPU InOR is still a little faster than IsIN which is due to the fact how the compiler builds the in - you can see that for yourself in the disassembly and then look at instruction timings, read up on macro-operation fusion and data dependency For reference, this is the assembly for the two functions when using consts Project1.dpr.40: Result := aID in [xControlsRec.ButtonID, xControlsRec.FormID, xControlsRec.ListBoxID, xControlsRec.TabControlID, xControlsRec.ComboBoxID]; 004CEE7C 83E802 sub eax,$02 004CEE7F 7417 jz $004cee98 004CEE81 83E802 sub eax,$02 004CEE84 7412 jz $004cee98 004CEE86 83E802 sub eax,$02 004CEE89 740D jz $004cee98 004CEE8B 83E802 sub eax,$02 004CEE8E 7408 jz $004cee98 004CEE90 83E802 sub eax,$02 004CEE93 7403 jz $004cee98 004CEE95 33C0 xor eax,eax 004CEE97 C3 ret 004CEE98 B001 mov al,$01 Project1.dpr.41: end; 004CEE9A C3 ret 004CEE9B 90 nop Project1.dpr.45: Result := (aID = xControlsRec.ButtonID) or (aID = xControlsRec.FormID) or (aID = xControlsRec.ListBoxID) or (aID = xControlsRec.TabControlID) or (aID = xControlsRec.ComboBoxID); 004CEE9C 83F802 cmp eax,$02 004CEE9F 7417 jz $004ceeb8 004CEEA1 83F804 cmp eax,$04 004CEEA4 7412 jz $004ceeb8 004CEEA6 83F806 cmp eax,$06 004CEEA9 740D jz $004ceeb8 004CEEAB 83F808 cmp eax,$08 004CEEAE 7408 jz $004ceeb8 004CEEB0 83F80A cmp eax,$0a 004CEEB3 7403 jz $004ceeb8 004CEEB5 33C0 xor eax,eax 004CEEB7 C3 ret 004CEEB8 B001 mov al,$01 Project1.dpr.46: end; 004CEEBA C3 ret Depending on the number of IDs you have it might be worth using power of two and bitmasks or an enum directly because that would only require one cmp/test making the function twice as fast and perfect for inlining which would then also eliminate the function call overhead at all.
×