Language:
Русский
English
{Erase.PAS}
▀▀▀▀▀▀▀▀▀▀▀▀▀
{Sample code for Erase procedure. }
uses WinDos;WinCrt;
var
F: file;
Ch: Char;
begin
{ Get file to delete from command line }
Assign(F, ParamStr(1));
{$I-}
Reset(F);
{$I+}
if IOResult <> 0 then
Writeln('Cannot find ', ParamStr(1))
else
begin
Close(F);
Write('Erase ', ParamStr(1), '? ');
Readln(Ch);
if UpCase(CH) = 'Y' then
Erase(F);
end;
end.