Язык:
Русский
English
{ Пример программы для функции FileSplit }
uses Strings, WinCrt, WinDos;
var
Path : array[0 .. fsPathName] of Char;
Dir : array[0 .. fsDirectory] of Char;
Name : array[0 .. fsFileName] of Char;
Ext : array[0 .. fsExtension] of Char;
begin
Write('Имя файла (WORK.PAS): ');
ReadLn(Path);
FileSplit(Path, Dir, Name, Ext);
if Name[0] = #0 then
StrCopy(Name, 'WORK');
if Ext[0] = #0 then
StrCopy(Ext, '.PAS');
StrECopy(StrECopy(StrECopy(Path, Dir), Name), Ext);
WriteLn('Полученное имя : ', Path);
end.
var
Path : array[0 .. fsPathName] of Char;
Dir : array[0 .. fsDirectory] of Char;
Name : array[0 .. fsFileName] of Char;
Ext : array[0 .. fsExtension] of Char;
begin
Write('Имя файла (WORK.PAS): ');
ReadLn(Path);
FileSplit(Path, Dir, Name, Ext);
if Name[0] = #0 then
StrCopy(Name, 'WORK');
if Ext[0] = #0 then
StrCopy(Ext, '.PAS');
StrECopy(StrECopy(StrECopy(Path, Dir), Name), Ext);
WriteLn('Полученное имя : ', Path);
end.