Вниз
Скачать: CL | DM;

как получить из полного пути, имя вайла и его расширение   Найти похожие ветки 

← →
lena19   (2004-06-06 21:28) [0]

всем привет
как получить из полного пути, имя вайла и его расширение


← →
AndersoNRules   (2004-06-06 21:29) [1]

ExtractFileName


← →
lena19   (2004-06-06 21:31) [2]

ок спасибо


← →
AlexG ©   (2004-06-06 21:31) [3]

Дополни > ExtractFileName F1, по вкусу, и добавь See also


← →
grom   (2004-06-06 21:37) [4]

("c:\sys\command.com" -> "command.com")
-------------------------------
function MyExtractFileName(const Path: string): string;
var
 i: integer;
begin
 Result := "";
 i := Length(Path);
 while ((Path[i] <> "\") and (Path[i] <> "/")) and (i > 0) do
   dec(i);
 if i = 0 then Result := Path else
     if i = Length(Path) then Result  := "" else
       Result := Copy(Path, i+1, Length(Path) - i);
end;


← →
Gero ©   (2004-06-06 22:03) [5]


> grom   (06.06.04 21:37)

А я лучше могу написать:

function MyExtractFileName(const Path: string): string;
begin
Result := ExtractFileName(Path);
end;


← →
GuAV ©   (2004-06-06 22:27) [6]


> function MyExtractFileName(const Path: string): string;
> begin
> Result := ExtractFileName(Path);
> end;

function GeroExtractFileName(const Path: string): string;
begin
Result := ExtractFileName(Path);
end;

function GuAVExtractFileName(const Path: string): string;
begin
Result := GeroExtractFileName(Path);
end;


← →
Gero ©   (2004-06-06 23:03) [7]


> GuAV ©   (06.06.04 22:27)

Во-во, кстати, в исходниках VCL я встречался с подобными примерами :)



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.018 c
3-1085739438
stoper
2004-05-28 14:17
2004.06.20
Экспорт даных в OpenOffice


14-1086074727
AlexeyITN
2004-06-01 11:25
2004.06.20
Сколько стоит лицензированный Delphi 4-5 ?


6-1083480866
lucky4me
2004-05-02 10:54
2004.06.20
Закачка HTTP


1-1086761992
artem_123
2004-06-09 10:19
2004.06.20
вопрос по mainmenu


1-1086330853
TGrey
2004-06-04 10:34
2004.06.20
Передача сообщений из потока




   Наверх