Código:
Saludos a todos!Gracias procedure CargarLista (var a:archi; var l:lista); {carga la lista con todos los datos del archivo}
var
r:reg;
p,actual,anterior:lista;
begin
if verifica(a) = false then
begin
writeln('NO EXISTE EL ARCHIVO: RECUERDE QUE PARA CARGAR ELEMENTOS EN UNA LISTA PRIMERO DEBE CARGAR EL ARCHIVO');
readkey;
end
else
begin
reset (a);
l:=nil;
while not eof(a) do
begin
read(a,r);
new(p);
p^.dato.nom_arq:=r.nom_arq;
p^.dato.nom_prop:=r.nom_prop;
p^.dato.fecha_inicio:=r.fecha_inicio;
p^.dato.fecha_fin:=r.fecha_fin;
p^.dato.t_construccion:=r.t_construccion;
p^.dato.sup_terreno:=r.sup_terreno;
p^.dato.sup_cubierta:=r.sup_cubierta;
p^.dato.sup_libre:=r.sup_libre;
p^.dato.ps:=nil;
actual:=l;
anterior:=nil;
while actual <> nil do
begin
anterior:=actual;
actual:=actual^.dato.ps;
end;
if anterior <> nil then
anterior^.dato.ps:=p
else
l:=p;
end;
close (a);
clrscr;
writeln('LA LISTA ESTA CARGADA');
readkey;
end;
end;

