procedure buscarcodigo;
var
found:boolean;
matricula2:byte;
pos:integer;
BEGIN
clrscr;
assign (datos, 'alumnos.txt');
reset(datos);
found:=false;
Writeln ('Dame el codigo del alumno a Buscar');
readln(matricula2);
seek (datos,0);
while not eof (datos) and not found do
begin
read (datos,persona);
if persona.matricula=matricula2 then
found:=true;
pos:=filepos(datos);
end;
if found and persona.sw=true then
begin
writeln (' ');
writeln ('Eston son los datos del alumno:');
writeln (' ');
writeln ('Matricula: ',persona.Matricula);
writeln ('Nombre: ',persona.nombre);
writeln ('Apellido P.: ',persona.apellidop);
writeln ('Apellido M.: ',persona.apellidom);
writeln ('Edad: ' ,persona.edad);
writeln ('Pais: ' ,persona.pais);
writeln ('Ciudad: ',persona.ciudad);
writeln ('Telefono Tutor: ', persona.telefono);
writeln ('Visa: ', persona.visa);
end
else
begin
textcolor(red);
writeln('Ese alumno no est ingresado');
end;
readln;
close(datos);
END;