Jump to content

Kryvich

Members
  • Content Count

    380
  • Joined

  • Last visited

  • Days Won

    8

Kryvich last won the day on September 29 2019

Kryvich had the most liked content!

Community Reputation

152 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi Community Edition

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Kryvich

    Delphi 5 - VirtualTreeView

    An external MM can help catch double free errors. Try FastMM4 by Pierre le Riche. Declared support for Delphi 4 (or later)
  2. @RCrandall You can put some likes for his answers in this thread, and thus increase his already high reputation on Delphi Praxis. 😉
  3. You are late. Somebody already posted this position here.
  4. I wrote about PAS2JS developers. PAS2JS is a subproject of FPC, written mostly in the same style.
  5. AFAIK, no free edition for CE. And you couldn't use the old Delphi CE 10.3 with the free FR because the registration keys for Delphi CE 10.3 have expired.
  6. There are several free and opensource REST libraries available so you don't have to start from scratch. I would recommend DMVCFramework -- a popular and powerful framework for web solution in Delphi. Supports RESTful and JSON-RPC APIs development. WiRL -- RESTful Library for Delphi. mORMot -- Synopse mORMot ORM/SOA/MVC framework See example applications to a specific framework.
  7. In 2018, a special edition of Fast Report was included in the package with the Delphi Community. Now you need to buy Fast Report yourself, or buy the Delphi Professional with Fast Report Embarcadero RAD Edition included.
  8. Definitely it would look better and not generate tons of compiler warnings in Delphi. They grab this practice from FPC. See pasresolver.pp, there are procedures like RaiseMsg, RaiseNotYetImplemented, RaiseInternalError, RaiseInvalidScopeForElement. All of them can be replaced with custom exceptions.
  9. I tried the TestInitialization project with Pascal Analyzer Lite, but it doesn't see a problem with using an uninitialized var parameter either. Perhaps the full paid version will determine this issue.
  10. I try to never allow hints or warnings in the release code. Right now I am adapting the latest version of the PAS2JS transpiler for Delphi. I see dozens of warnings that Delphi shows. Most of them are false positive, such as an undefined function return value (W1035) after an exception is generated (RaiseInternalError(...);). But some potentially problematic places went unnoticed by the PAS2JS developers. Also, a lot of warnings are generated due to the different internal representation of strings in Free Pascal (UTF8) and Delphi (Unicodestring). I carefully study all warnings and correct the code.
  11. The compiler should generate absolutely the same code for var and out parameters, both for the calling and for the called subroutines. The only difference will be in the warnings it issues: Warning var parameter out parameter Where to show 1. W1036 Variable might not have been initialized yes no Calling routine 2. The parameter must be initialized before use no yes Called routine 3. Return value of parameter might be undefined no yes Called routine Warnings 2. and 3. should work in the same way as for the Return value of a function (W1035 Return value of function might be undefined). That is, all the necessary checks (W1035, W1036) are already in the compiler, Embarcadero only has to apply them to the parameters where necessary.
  12. Checking the initialization of var parameters before use is a basic thing that does not require deep analysis. In fact, it has already implemented for parameters passed by value. procedure Test; procedure DoStuff({var} a: Integer); begin if a = 0 then a := 1; end; var a: Integer; begin DoStuff(a); // W1036 Variable 'a' might not have been initialized Writeln(a); end;
  13. Good article. The main point against using the out parameter in Delphi is sub-optimal generated code, due to the need to maintain compatibility with C++ Builder. But how often is Delphi code used in C++? Maybe a better solution would be to add additional checks and parameter initializations to the calling C++ code?
  14. The FPC compiler shows a hint like this in this case: Hint: Local variable "a" does not seem to be initialized But I'm sure this should be a warning, not a hint.
  15. I created a minimal reproducible example for this case. program TestInitialization; {$APPTYPE CONSOLE} procedure Test; procedure DoStuff(var a: Integer); begin if a = 0 then a := 1; end; var a: Integer; begin DoStuff(a); Writeln(a); end; begin Test; Readln; end. It's strange that the compiler doesn't show a warning W1036 Variable 'a' might not have been initialized. This is definitely an oversight.
×