Pascal/Turbo Pascal - mostrar registro

 
Vista:

mostrar registro

Publicado por sonny (10 intervenciones) el 15/05/2008 02:44:08
hola a todos estoy haciendo un registro ya hice el primer paso que es el de ingresar ahora quiero mostrarlo,consultar un registro determinado,modificarlo,eliminarlo, por ahora necesito MOSTRARLO.....en lo que me puedan ayudar se los agradezco...

aca les dejo mi codigo....

program menuregi;
uses crt;

{procedimiento para el menu principal}

procedure menup;

var
op:char;
opAnt,opAct:byte;


procedure mover_menu(ant,act:byte);
begin
textcolor(15);
textbackground(0);
case ant of
1:begin gotoxy(30,10); write(' INGRESAR '); end;
2:begin gotoxy(30,11); write(' MOSTRAR '); end;
3:begin gotoxy(30,12); write(' CONSULTAR'); end;
4:begin gotoxy(30,13); write(' MODIFICAR'); end;
5:begin gotoxy(30,14); write(' ELIMINAR '); end;
6:begin gotoxy(30,15); write(' SALIR '); end;

end;

textcolor(0);
textbackground(7);
case act of
1:begin gotoxy(30,10); write(' INGRESAR '); end;
2:begin gotoxy(30,11); write(' MOSTRAR '); end;
3:begin gotoxy(30,12); write(' CONSULTAR');end;
4:begin gotoxy(30,13); write(' MODIFICAR'); end;
5:begin gotoxy(30,14); write(' ELIMINAR '); end;
6:begin gotoxy(30,15); write(' SALIR '); end;

end;

end;

{procedimiento para ingresar registros}
procedure ingresar;
type
regis=record
nom:string[15];
ape:string[15];
tel:real;
dir:string[25];
ema:string[30];
end;

var
datos:regis;

begin
clrscr;
gotoxy(8,8);
write('NOMBRE: ');readln(datos.nom);
gotoxy(30,8);
write('APELLIDO: ');readln(datos.ape);
gotoxy(8,10);
write('TELEFONO: ');readln(datos.tel);
gotoxy(30,10);
write('DIRECCION: ');readln(datos.dir);
gotoxy(8,12);
write('E-MAIL: ');readln(datos.ema);

end;


begin

Textcolor(15);
textbackground(0);
clrscr;
opAnt:=0;

opAct:=1;

repeat
textcolor(15);

textbackground(0);
clrscr;
gotoxy(28,5); write(' AGENDA');
gotoxy(30,10); write(' INGRESAR ');
gotoxy(30,11); write(' MOSTRAR ');
gotoxy(30,12); write(' CONSULTAR');
gotoxy(30,13); write(' MODIFICAR');
gotoxy(30,14); write(' ELIMINAR ');
gotoxy(30,15); write(' SALIR ');


mover_menu(opant,opact);

repeat
op:=readkey;
until op in [#13,#27,#72,#80];


if op=#72 then begin
opant:=opact;
if opact=1 then
opact:=6
else
dec(opact);
end
else
if op=#80 then begin
opant:=opact;
if opact=6 then
opact:=1
else
inc(opact);
end
else

if (op =#13) and (opact<>6) then begin
textcolor(15);
textbackground(0);
clrscr;
case opact of
1:begin
ingresar;
gotoxy(15,20);
write('Esc PARA SALIR');
end;
2:begin

gotoxy(15,5);
write('MOSTRAR');
gotoxy(15,20);
write('Esc PARA SALIR');
end;

3:begin
gotoxy(15,5);
write('CONSULTAR');
gotoxy(15,20);
write('Esc PARA SALIR');
end;

4:begin
gotoxy(15,5);
write('MODIFICAR');
gotoxy(15,20);
write('Esc PARA SALIR');
end;

5:begin
gotoxy(15,5);
write('ELIMINAR');
gotoxy(15,20);
write('Esc PARA SALIR');
end;
end;
readkey;
end;
until (op =#27) or ((op=#13) and (opact=6))

end;

{programa principal}
begin

menup;

end.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder