Obtener un nombre para ficheros temporales que no coincida con ninguno que haya en el directorio
0000-00-00 00:00:00
function existe(fichero : string) : boolean;
var fich : file of byte;
begin
ASSIGN(fich,fichero);
\{\$I-}
RESET(fich);
close(fich);
\{\$I+}
existe := ioresult = 0;
end;
Function Temp(Name,Ext : string) : string;
var
TCa : Word;
s : string;
Begin
TCa:=0;
repeat
s:=LeadingZero(TCa,4);
s:=Name+s+'.'+ext;
inc(TCa);
Until not existe(s);
Temp:=s;
End;