Usually I don't really care about Delphi's way of doing it, but this one got me thinking what am I missing here:

Usually I don't really care about Delphi's way of doing it, but this one got me thinking what am I missing here:
In one simple unit I use SelectDirectory and DirectoryExists functions. Both from Vcl.FileCtrl. All working good, until I noticed the message: W1000 Symbol 'DirectoryExists' is deprecated: 'Use SysUtils.DirectoryExists instead'.

So, now instead of using Vcl.FileCtrl only for both functions, I need to use SysUtils unit and prefix SysUtils.DirectoryExists. I don't get this. If I use 3rd Party units, I get it, I need to prefix if they use same names as Delphi's own functions. But for Delphi's source functions... can't they come up with a solution where this is not needed and deprecated functions are just not used.

Or am I missing something here and this makes a lot of sense, I'm just not that experienced Delphi developer, yet?

Comments

  1. Mike Torrettinni Vcl.FileCtrl has DirectoryExists in my version of Delphi 10.2 Tokyo. OK, it is marked deprecated, but nevertheless it still exists and can be used.

    ReplyDelete
  2. David Heffernan One of the three overloads of SelectDirectory is just a wrapper around TFileOpenDialog.Execute. Why reinvent the wheel here?

    ReplyDelete
  3. Uwe Raabe I suppose because that unit has its problems. I'd rather keep it out of my program.

    ReplyDelete

Post a Comment