Intenté con Delphi XE y obtuve No Respondiendo mientras compilaba. ¿Funciona en su computadora o hay algún problema con la función?¿No responde al compilar esta función?
function Test(const FileName: string;
const Force: boolean = false): boolean;
var
IsAllowed: boolean;
begin
result := false;
if FileExists(FileName) then
begin
try
if (Force) then
begin
result := false;
exit;
end;
finally
if IsAllowed then
DeleteFile(FileName);
end;
try
result := true;
except
result := false;
end;
end;
end;
Esa función compila bien en mi Delphi 2010. –