Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?



Permlink Replies: 6 - Last Post: May 30, 2017 10:47 AM Last Post By: Rudy Velthuis (... Threads: [ Previous | Next ]
Asger Joergensen

Posts: 370
Registered: 11/18/08
ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 20, 2017 3:26 AM
Hi

In Vcl.FileCtrl.pas I see this line:
function ForceDirectories(const Dir: string): Boolean; deprecated 'Use SysUtils.ForceDirectories instead';
and the same goes for: DirectoryExists

but if I write: SysUtils::ForceDirectories i get an error

So if I need to include both System.SysUtils.hpp and Vcl.FileCtrl.hpp how do
I make sure I get the right one ?

Thanks in advance
Best regards
Asger
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 20, 2017 12:21 PM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger Joergensen wrote:

Hi

In Vcl.FileCtrl.pas I see this line:
function ForceDirectories(const Dir: string): Boolean; deprecated
'Use SysUtils.ForceDirectories instead'; and the same goes for:
DirectoryExists

but if I write: SysUtils::ForceDirectories i get an error

So if I need to include both System.SysUtils.hpp and
Vcl.FileCtrl.hpp how do I make sure I get the right one ?

AFAIK, namespaces are not CamelCapped, just capitalized:

See System.SysUtils.hpp:

  namespace Sysutils
  {


So it is Sysutils::ForceDirectories, not SysUtils::ForceDirectories.

--
Rudy Velthuis http://www.rvelthuis.de

"I never forget a face, but in your case I'll be glad to make an
exception." -- Groucho Marx
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 20, 2017 12:30 PM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy Velthuis (TeamB) wrote:

Asger Joergensen wrote:

Hi

In Vcl.FileCtrl.pas I see this line:
function ForceDirectories(const Dir: string): Boolean; deprecated
'Use SysUtils.ForceDirectories instead'; and the same goes for:
DirectoryExists

but if I write: SysUtils::ForceDirectories i get an error

So if I need to include both System.SysUtils.hpp and
Vcl.FileCtrl.hpp how do I make sure I get the right one ?

AFAIK, namespaces are not CamelCapped, just capitalized:

See System.SysUtils.hpp:

  namespace Sysutils
  {


So it is Sysutils::ForceDirectories, not SysUtils::ForceDirectories.

I mean the ones generated by Delphi, of course, not namespaces in
general.

--
Rudy Velthuis http://www.rvelthuis.de

"Just drive down that road, until you get blown up."
-- General George Patton, reconnaissance troops

Edited by: Rudy Velthuis (TeamB) on May 20, 2017 9:32 PM
Asger Joergensen

Posts: 370
Registered: 11/18/08
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 20, 2017 1:55 PM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Hi Rudy

Rudy Velthuis (TeamB) wrote:

Asger Joergensen wrote:
'Use SysUtils.ForceDirectories instead'; and the same goes for:

AFAIK, namespaces are not CamelCapped, just capitalized:

So it is Sysutils::ForceDirectories, not SysUtils::ForceDirectories.

You are absolutely right, thanks.

I did copy and paste from the Vcl.FileCtrl.pas file though.:(

Best regards
Asger
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 22, 2017 1:46 AM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger Joergensen wrote:
Hi Rudy

Rudy Velthuis (TeamB) wrote:

Asger Joergensen wrote:
'Use SysUtils.ForceDirectories instead'; and the same goes for:

AFAIK, namespaces are not CamelCapped, just capitalized:

So it is Sysutils::ForceDirectories, not SysUtils::ForceDirectories.

You are absolutely right, thanks.

I did copy and paste from the Vcl.FileCtrl.pas file though.:(

Best regards
Asger

Well, in Pascal, case doesn't matter. And I think that, in pascal, the namespace is indeed spelled as SysUtils :)
Asger Joergensen

Posts: 370
Registered: 11/18/08
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 22, 2017 1:51 AM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Hi Jan

Jan Dijkstra wrote:


Well, in Pascal, case doesn't matter. And I think that, in pascal,
the namespace is indeed spelled as SysUtils :)

I just love the consistent naming.;)
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: ForceDirectories deprecated Use SysUtils.ForceDirectories, but how ?
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 10:47 AM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger Joergensen wrote:

Hi Jan

Jan Dijkstra wrote:


Well, in Pascal, case doesn't matter. And I think that, in pascal,
the namespace is indeed spelled as SysUtils :)

I just love the consistent naming.;)

There is a method to that. All unit names are consistently converted
(by the Delphi compiler!) to a Unitnamewithoutcamelcaps namespace, so
it doesn't matter how the Pascal people spell it. Note that
UnitnameWithoutCamelcaps or UnitNameWithoutCamelCaps would be the same
unit in Delphi, but not in C++. So all unit names are normalized.

--
Rudy Velthuis http://www.rvelthuis.de

"By trying we can easily learn to endure adversity; another
man's, I mean."
-- Mark Twain
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02