Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Conflict between TPath.GetPublicPath and SysUtils.ExtractFilePath


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Apr 13, 2016 10:55 AM Last Post By: Remy Lebeau (Te...
Bruce Eglington

Posts: 34
Registered: 1/24/03
Conflict between TPath.GetPublicPath and SysUtils.ExtractFilePath  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 12, 2016 9:49 PM
I use Delphi XE8 Pro and am encountering a problem when trying to use both TPath.GetPublicPath (e.g. somestring := TPath.GetPublicPath;) and SysUtils.ExtractFilePath (e.g. someotherstring := SysUtils.ExtractFilePath(longstring);)

I have both System.IOUtils and System.SysUtils defined in my USES statement. If I omit SysUtils from the uses clause then the GetPublicPath statement is accepted )but obviously not ExtractFilePath) and the reverse when IOUtils is included but not SysUtils.

Can anybody explain what I am doing wrong?

Thanks
Bruce
Linden ROTH

Posts: 467
Registered: 11/3/11
Re: Conflict between TPath.GetPublicPath and SysUtils.ExtractFilePath  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 12, 2016 10:16 PM   in response to: Bruce Eglington in response to: Bruce Eglington
Bruce Eglington wrote:
I use Delphi XE8 Pro and am encountering a problem when trying to use both TPath.GetPublicPath (e.g. somestring := TPath.GetPublicPath;) and SysUtils.ExtractFilePath (e.g. someotherstring := SysUtils.ExtractFilePath(longstring);)

I have both System.IOUtils and System.SysUtils defined in my USES statement. If I omit SysUtils from the uses clause then the GetPublicPath statement is accepted )but obviously not ExtractFilePath) and the reverse when IOUtils is included but not SysUtils.

Can anybody explain what I am doing wrong?

Thanks
Bruce
the following works for me

procedure TForm13.Button1Click(Sender: TObject);
var
  s : string;
  s2 : string;
begin
  s := TPath.GetPublicPath;
  s2 := System.sysutils.ExtractFilePath(s );
  showmessage( s );
end;
 


NB s2 := sysutils.ExtractFilePath(s );is invalid

unless you use SysUtils NOT System.SysUtils

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Conflict between TPath.GetPublicPath and SysUtils.ExtractFilePath  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 13, 2016 10:55 AM   in response to: Bruce Eglington in response to: Bruce Eglington
Hello Bruce,

I use Delphi XE8 Pro and am encountering a problem when trying to
use both TPath.GetPublicPath and SysUtils.ExtractFilePath

What is the actual problem?

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02