Unnamed
public text v1 · immutableprocedure ApagaPasta(pasta: string);
var
Arquivo: TSearchRec;
begin
if FindFirst(pasta+'*.*', 0, Arquivo) = 0 then
begin
repeat
DeleteFile(pasta+Arquivo.Name);
until FindNext(Arquivo) <> 0;
FindClose(Arquivo);
end;
if (RemoveDir(pasta) = TRUE) then
showmessage('Pasta apagada com sucesso!')
else
showmessage('Falha ao apagar a pasta');
end;