Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/22/23 in all areas

  1. As long as we are talking about personal opinions, mine is just not moved much by this reasoning. Record pointers are nothing exotic or anachronistic in Delphi. That is a lot more common than having classes with no methods, imo. Also, there is nothing superior about a free call on a class compared to calling dispose on a record pointer. The Delphi language absolutely requires learning memory management. The removal of the misguided ARC baggage from the language shows that will not be changing. No reason to try to find ways to dumb it down.
  2. I would do something like this: [mru] count=N path1=... path2=... ... pathN=... Keep adding new paths to the front of the list until the desired count is reached, then remove the oldest path from the end of the list each time a new path is added.
  3. Hello, this is the information that a version 2.1 of Delphi Code Coverage Wizard Plus has been released today. It can be found here: https://github.com/MHumm/delphi-code-coverage-wizard-plus/releases/tag/V2.1 and hopefully soon via Tools/GetIt package manager. What's new? updated code coverage command line tool used fixed duplicate accelerator keys on generate and run menu/page added support for new -ecp class prefix exclusion parameter added support for new -lcl parameter added support for new -ife and -efe parameters made Delphi 12.0 Athens known to the tool for IDE tools menu integration Enjoy TurboMagic
  4. It doesn't stand anywhere that after 5 installations/registration and a year, you can send the perpetual license to trash. And as stated below they know what an annual license is and what a perpetual is. Just curious that there is no delphi "pro term license" and rad studio.
  5. Remy Lebeau

    Help with Query at run time

    You should not use TDirectory.GetCurrentDirectory() to get the EXE path, as the CWD is dynamic. It is subject to whatever path the launcher of the EXE wants to use, and it can also change value during the EXE's runtime. Instead, use TApplication.ExeName or ParamStr(0) to get the full path to the EXE file, and then strip off the filename with ExtractFilePath()/ExtractFileDir() or TPath.GetDirectoryName(). Though, you really should not be storing ANY mutable application data in the EXE's folder to begin with.
  6. The two versions are identical, apart from the double dereference with the class wrapper version. That's the only part that seems ugly to me.
  7. Perpetual license is not perpetual support. That means if your support expires you are on your own as far as keeping a copy of your installer files and what to do when you need to install again, etc. Not really a big deal when you can download the ISOs, and if you didn't do that when you bought it intending not to subscribe, that is 100% on you. As to installation limits, my understanding is that you can get that taken care of by contacting sales. Personally I really, really dislike this policy on the part of Embarcadero, but I do understand their interest in preventing licenses from being abused. Now, if they refuse to bump your activation limit, you have something worth complaining about...
  8. This is correct. Raw pointer in C++ is directly analogous to typer pointer in Delphi. However a reference to a class instance is actually no different from a raw pointer. You have to manage allocation and deallocation of both. Which is my point.
  9. PeterBelow

    Syndey and Athens in same PC

    You can install major versions in parallel but there is one known problem with D11 and D12 if you use certain IDE add-ins (Parnassus bookmarks and one other) due to a naming conflict in some DLLs they use. See here.
  10. Well, in Delphi we commonly use phrases untyped and typed pointers. so when you say raw pointer in Delphi context my immediate association is untyped pointer, especially since your next comparison with C++ unique pointer and shared pointer which are automatically managed was completely unrelated feature to Delphi objects which are not automatically managed. So I assumed that you wanted to say untyped, as I haven't made the connection with the rest and what you are trying to say. I am still not certain what was your original point... as it seems that you were arguing for both style and memory management, otherwise why mentioning unique and shared pointer. I have chosen to disregard the automatic memory management part as this would be adding additional level of complexity and focus on the class part alone. Again, that depends on the rest of the code. In general, if you are dealing with records, then using typed pointer to that record is more consistent and idiomatic than wrapping that record into a class, just to have it allocated on the heap. Especially, since Delphi no longer requires dereferencing typed pointers when working with their content. TRec = record x: Integer; end; PRec = ^TRec; TRecObject = class public r: TRec; end; var p: PRec; begin New(p); try p.x := 5; finally Dispose(p); end; end; var o: TRecObject; begin o := TRecObject.Create; try o.r.x := 5; finally o.Free; end; end If you look at the above code, the using pointer makes code more readable than having wrapped record as you can directly access its content through pointer reference instead of having another level of indirection between.
  11. dummzeuch

    Syndey and Athens in same PC

    You can install all main versions of Delphi in parallel. Since Delphi 10.4 (Sydney) and Delphi 12 (Athens) are both main versions, you are fine. Note though, that Delphi 12 will register itself for opening all Delphi related files so double clicking on a project will open it in Delphi 12 which might not be what you want. (All 10.x Versions (10.0 .. 10.4) were main versions, 10.x.y versions were updates to 10.x. Fortunately Embarcadero has stopped this silly numbering scheme now, but we have to live with that legacy.)
  12. Ian Branch

    Set a default parameter for a function??

    Hi pmcgee, Interesting, never come across them nor can I say I have seen them. What does FAIL represent? Ian
  13. DelphiUdIT

    Your experience with custom styles - do they work well?

    I used and currently use styles. I customized two styles and since years I use those. Even with Delphi 12 there is a need for "Rodrigo Ruz's VCL Style Utils" to refine some smudges of some components (one for all TSplitView). I think, as others have said in that thread, that the look and feel are greatly improved over the normal OS dependent look.
  14. Remy Lebeau

    TCP ping

    There is no such as a "TCP ping". Ping (ICMP) operates at a different protocol level than TCP. A ping can only tell you whether a machine/device is reachable on the LAN (assuming it even implements ICMP, and that ICMP is not being blocked by routers/firewalls, etc). But it cannot tell you whether there is an app actually listening on any TCP port on that machine/device. You would have to actually connect to a port to verify connectivity. That is what port scanners do.
  15. Stefan Glienke

    Create a new instance of a generic class

    You can trick/hack a bit and do what you want to achieve manually: This is basically what a regular ctor call on the class type does (see System._ClassCreate). function TSomeClass<T>.CreateNewInstance: ISomeInterface<T>; var obj: TSomeClass<T>; begin obj := TSomeClass<T>(ClassType.NewInstance); obj.Create(fSomeParameters); Result := obj; end;
  16. Jonah Jeleniewski

    SonarDelphi v1.0.0 released!

    We are pleased to announce the release of SonarDelphi v1.0.0. SonarDelphi is a free and open-source Delphi language plugin for the SonarQube code quality platform. GitHub: https://github.com/integrated-application-development/sonar-delphi Release: https://github.com/integrated-application-development/sonar-delphi/releases/tag/v1.0.0 Background If you're thinking "I've seen this before", you're probably right! SonarDelphi was originally open-sourced by Sabre Airline Solutions in 2012. It's bounced from maintainer to maintainer on GitHub (including Embarcadero). This project is a greatly improved version that has been actively developed (and extensively rewritten) by IntegraDev for the last 4 years. Features Powerful semantic analysis 120+ analysis rules Custom rules via templates or a programmatic java API Import NUnit test reports (compatible with DUnitX) Import test coverage reports (compatible with DelphiCodeCoverage) Feedback and contributions are welcome!
  17. This is all documented. Obviously we can tell you the answers but once you know about New, you can read the documentation to find out the rest of the details. It's really useful to know how to do that.
  18. Or explicitly mark assignment to a field: Self.Item := Item
×