Pascal/Turbo Pascal - necesito que la entrada de clave se pueda usar la tecla de borrar

 
Vista:
sin imagen de perfil

necesito que la entrada de clave se pueda usar la tecla de borrar

Publicado por Melisa (6 intervenciones) el 01/10/2021 01:24:03
como puedo hacer para que el cliente pueda borrar sio sabe que ingreso mal la contaseña?




Procedure LECTURACONTRA (OPC:char);
var
ch:char;
password, CLAVE: string;
cont:integer;
begin
ClrScr;
cont:= 0;
if (OPC='1') then
begin
CLAVE:='EMPRESA123';
repeat
write('Ingrese la CLAVE de ACCESO EMPRESA: ');
ch:= readkey ;
password:='';
while (ch<>#13) do
begin
if ch<>#8 then
begin
password:=password+ch;
write('*');
ch:=readkey; end
else
Delete(password,Length(password),1);
write('');
end;
if password = CLAVE then
begin
ClrScr ;
Gotoxy (24,02); Write ('+----------------------------------+');
Gotoxy (24,03); Write (': ACCESO CORRECTO :');
Gotoxy (24,04); write (': :');
Gotoxy (24,05); Write ('+----------------------------------+');
Delay (1100);
ClrScr ;
MENUEMPRESA;
end
else
begin
cont:=cont+1;
ClrScr ;
Gotoxy (24,02); Write ('+----------------------------------+');
Gotoxy (24,03); Write (': CONTRASEnA INCORRECTA :');
Gotoxy (24,04); write (': INTENTO NUM: ',cont,' :');
Gotoxy (24,05); Write ('+----------------------------------+');
password:='';
Delay (1000);
ClrScr ;
end
until (password='EMPRESA123') or (cont=3)
end;
if (OPC='2') then
repeat
write('Ingrese la CLAVE de ACCESO CLIENTE: ');
ch:=readkey;
password:='';
while (ch<>#13) do
begin
password:=password+ch;
write('*');
ch:=readkey;
end;
if password = 'CLIENTE123' then
begin
ClrScr ;
Gotoxy (24,02); Write ('+----------------------------------+');
Gotoxy (24,03); Write (': ACCESO CORRECTO :');
Gotoxy (24,04); write (': :');
Gotoxy (24,05); Write ('+----------------------------------+');
Delay (1000);
ClrScr ;
MENUCLIENTE_ING;
OPC:='0';
end
else
begin
cont:=cont+1;
ClrScr ;
Gotoxy (24,02); Write ('+----------------------------------+');
Gotoxy (24,03); Write (': CONTRASEnA INCORRECTA :');
Gotoxy (24,04); write (': INTENTO NUM: ',cont,' :');
Gotoxy (24,05); Write ('+----------------------------------+');
password:='';
Delay (1000);
ClrScr ;
end
until (password='CLIENTE123') or (cont=3);
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