Registriert seit: 14. Aug 2004
1.439 Beiträge
Delphi 2007 Professional
|
Re: Prüfen ob relativer oder absoluter Pfad
2. Apr 2005, 12:03

Zitat von alcaeus:
Da kann ich mit einem Vierzeiler dagegenhalten:
Delphi-Quellcode:
function IsRelativePath(Path: String): Boolean;
begin
Result := (Path[2] <> ':') and (Copy(Path, 1, 2) <> '\\');
end;
Die Funktion kommt auch mit Verzeichnissen wie klar, denn das waere auch ein absoluter Pfad.
Greetz
alcaeus
... und bei einem Path von nur einem Zeihen dann eine AV
Delphi-Quellcode:
function IsRelativePath(Path: String): Boolean;
begin
Result := (Copy(Path, 2, 1) <> ':') and (Copy(Path, 1, 2) <> '\\');
end;
Gruss Hans
2B or not 2B, that is FF
|
|
Zitat
|