program direcciones;
uses
crt,dos;
type
tarchivo= file of string;
var
rutas:tarchivo;
nomb,nombres:string;
function validar():string;
var
s:string;
c:char;
validos:set of char;
n:integer;
cod:longint;
Begin
s:='';
validos:=['a'..'z','\',':','.'];
repeat
c:=readkey;
if c in validos then
begin
write(c);
s:=s+c;
end
until c=#13;
validar:=s;
end;
begin
clrscr;
assign(rutas,'rutas.dat');
rewrite(rutas);
write('Ingrese ruta del archivo de facturas:');
nombres:=validar();
write(rutas,nombres);
close(rutas);
reset(rutas);
read(rutas,nombres);
close(rutas);
assign(nomb,nombres);
{$I-}
reset(nomb);
{$I+}
if (ioresult<>0) then
rewrite(nomb);
write(nomb,'pepe');
close(nomb);
readkey;
end.