Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/01/19 in all areas

  1. Rudy Velthuis

    Forked VSCode for Delphi

    Like the late Ed Mulroy (TeamB) once wrote:
  2. Job espejel

    Blast from the past: BDE and Win10 W/S

    Hello Please use pxrest.exe (Table Restructure utility) and set the version to 7 and Block size to 32768 for each table, then use reBuilder Hope this helps Regards
  3. Uwe Raabe

    Constructors + Destructors in class helpers?

    Especially as one cannot override virtual methods in a class helper.
  4. A.M. Hoornweg

    Constructors + Destructors in class helpers?

    Class helpers are merely a bunch of procedures and functions grouped together that mimic methods of a class. Each method has an invisible first parameter that passes the object and treats it as if it were "self". So literally nothing gets constructed or destructed, they're merely procedures/functions that act on an object. The advantage of class helpers is that one can extend a class, without actually inheriting from it, and that everything is neatly wrapped inside the namespace of that class. As an analogy, it's a bit like having an optional side car attached to a motor cycle, instead of permanently changing the vehicle itself. The major disadvantage of class helpers is that there can only be one helper "in scope" for your code (so the sequence of units in your "uses" clause suddenly becomes important). (Edit) but of course a class helper can have a method that returns a new instance of the class (or of any other class), but that's not really a constructor. It would be a factory method.
  5. Alexander Sviridenkov

    Context sensitive code completion and syntax checking

    Yes, this is part of HTML Library bundle. Code editor combines Scripter and SQL framework to make code completion works for both pascal and SQL code in one window. Also this demo shows ability to add design time method checking for classes in scripter (in this case checker is added to TXQuery class and checks that parameters in SQL query corresponds to parameter array).
  6. Markus Kinzler

    Context sensitive code completion and syntax checking

    I guess it's smart mobile studio.
  7. dummzeuch

    Forked VSCode for Delphi

    And then there are the small tools, that are (planned to be) used only for a special problem and then probably never again. It's OK, if you tightly couple UI and business logic if it makes writing them faster (true RAD). Unfortunately some of these tend to live longer than expected and functionality tends to be added later, which would require a redesign. But of course that never happens, because "it works as it is" and the new functionality is "just a very simple addition".
  8. Primož Gabrijelčič

    FastMM4 large memory allocation–benchmarking VirtualAlloc

    ... or my recent additions for finding allocation/deallocation bottlenecks: https://www.thedelphigeek.com/2016/02/finding-memory-allocation-bottlenecks.html You'll also get much better leak reporting. That alone is worth using the fresh github version.
  9. Stefan Glienke

    Unused local variables

    As Jeroen already mentioned: use DelphiAST - that is based on the Castalia parser code which was based on Martin Waldenburgs code. It is used and maintained by the author of FixInsight and many others and can handle any Delphi code out there. It had a lot of fixes due to it being used in FixInsight which is widely used by numerous people. It even supports inline variables (hello Error Insight!)
  10. Sherlock

    Unused local variables

    Please, don't waste energy on reinventing the wheel. The hint H2164 is there and even if I rebuild 3rd party every time I still see hints and warnings coming from my code.
  11. Bill Meyer

    Unused local variables

    It's been a very long time since I trusted much in the "compile" option. I don't recall (later than Delphi 1) that it ever felt very reliable.
  12. dummzeuch

    Unused local variables

    Kick those lazy bastards into the ass! 😉 As a workaround you could add a {$warnings off} and {$hints off} into theses 3rd party units.
  13. dummzeuch

    Unused local variables

    What do you mean by "log filled with various warnings"? Do you really have more than a hand full? That's the first thing I kick a coworker's ass for, if it gehts checked in to SCM. OK, a possible solution would be to configure these hints / warnings you are really interested into be errors in the project configuration -> Building -> Delphi Compiler -> Hints and Warnings. edit: Apparently that's not possible for hints but only for warnings.
  14. The quality of the online documentation for Delphi at docwiki.embarcadero.com has improved significantly since the time when Borland fired all their help authors, so it is actually worth looking at when you want to know anything. I see links to topics in that documentation in blog posts and in online forums (e.g. DelphiPraxis [German] [English]), but they always link to a specific version of that documentation (e.g. the one for Delphi 10.1 Berlin). I am sure most posters would like to link to the latest version rather than a specific version but don’t know how to do that or that it is even possible. The good news is: It is possible [...] https://blog.dummzeuch.de/2018/11/30/linking-to-the-current-delphi-documentation/
  15. Primož Gabrijelčič

    For..to..step in Delphi

    Today I was porting some legacy code and noticed a weird warning: Weird warning, I thought. Obviously the loop variable can be passed as a var parameter as the code compiles. Why a warning and not an error, then? Stefan later reminded me that warnings are quite extensively covered in the documentation. Indeed, the docs for W1015 clearly state: Ah! So they actually want to say “… FOR-Loop variable ‘i’ should not be …” Furthermore, this brings several interesting possibilities to the table. For example, we can finally write for..to..step loops in Delphi! program ForInStep; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; procedure Step(var loop: integer; step: integer); begin loop := loop + step - 1; end; var i: integer; begin for i := 1 to 10 do begin Writeln(i); Step(i, 2); end; Readln; end. Indeed, this works! Danger, Will Robinson! To be clear, I do not recommend writing such code. If you get warning W1015, you should rewrite the code. Such code is hard to maintain and will eventually cause you big problems. I certainly did fix the original code although the method that was called from the for loop did not modify its var parameter. (It was declared var and not const because the method was written before const parameters were introduced to Delphi. Oh, the joys of legacy code!)
  16. Georgge Bakh

    Forked VSCode for Delphi

    Yes, when someone from "outer world" comes to Delphi ecosystem IDE is the first thing to be discouraged with. Because there are many serious problems indeed. It's a good idea to take an existing high quality and extensible IDE and use it as a base for new Pascal IDE. I think it's much better than try to extend Delphi IDE with plugins. The base platform should be designed with many things in mind: indexing, threading, data integrity, real time code analysis, cross platform to name a few. UI is also an important (and often underestimated!) part. On the other side I see no reason to recreate a form designer. It's good enough in Delphi (or Lazarus). What's about a language server - it's good to have to bring Pascal support to many editors at once, but it's not a way for first-class IDE.
×