Autor Beitrag
schitho
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 288

XP Home SP2
D2005 Prof
BeitragVerfasst: Di 14.02.06 22:32 
Hi,

wie kann ich den übergeordneten Pfad eines Ordners ermitteln?

Hier ein paar Beispiele, wie ich das meine:

c:\Test\ -> c:\
e:\MeinOrdner\Dokumente\ -> e:\MeinOrdner\

Danke

Gruß
Thomas

_________________
(Sorry! Leider ewiger Delphi-Neuling)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Di 14.02.06 22:41 
Stand im EasyHelper nicht von Mir.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function GetPreviousDirectory(const APath: String): String;
var
  i: Integer;
begin
  Result:=APath;
  i:=Length(APath);
  If i>3 Then
  Begin
    Repeat
      Dec(i);
    Until (APath[i] = '\') OR (i=1);
    If APath[i]='\' Then
      Result:=Copy(APath,1,i);
  End;
end;
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 15.02.06 22:38 
Ist Das Thema Erledigt Danke !
schitho Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 288

XP Home SP2
D2005 Prof
BeitragVerfasst: Mi 15.02.06 22:42 
Ja! Vielen Dank!!!

Gruß
Thomas

_________________
(Sorry! Leider ewiger Delphi-Neuling)