Language:
Русский
English
{Reset.PAS}
▀▀▀▀▀▀▀▀▀▀▀▀▀
{Sample code for the Reset procedure.}
function FileExists(FileName: String): Boolean;
{ Boolean function that returns True if the file exists;otherwise,
it returns False. Closes the file if it exists. }
var
F: file;
begin
{$I-}
Assign(F, FileName);
Reset(F);
Close(F);
{$I+}
FileExists := (IOResult = 0) and (FileName <> '');
end; { FileExists }
begin
if FileExists(ParamStr(1)) then {Get file name from command line}
Writeln('File exists')
else
Writeln('File not found');
end.