Solución... cambiar el orden de los if
Código Delphi [-]procedure TForm1.findClick(Sender: TObject);
var
i: integer;
begin
for i:= 0 to clvs.Items.Count -1 do
begin
if (clvs.Items.Item[i].SubItems.Strings[2] = edit3.Text) and
(length(clvs.Items.Item[i].SubItems.Strings[1]) > 32) then
begin
ShowMessage('La contraseña es demasiado larga para mostrarla aquí,'+#13#10+
'se le mostrará temporalmente en el campo texto'+#13#10+
'"Buscar contraseña".');
edit3.Text:= clvs.Items.Item[i].SubItems.Strings[1];
end;
if (clvs.Items.Item[i].SubItems.Strings[2] = edit3.Text) and
(length(clvs.Items.Item[i].SubItems.Strings[1]) < 32) then
begin
ShowMessage('La contraseña es: '+ clvs.Items.Item[i].SubItems.Strings[1]);
break;
end;
end;
end;
saludo.
__________________
La juventud pasa, la inmadurez se supera, la ignorancia se cura con la educación, y la embriaguez con la sobriedad, pero la estupidez dura para siempre. Aristofanes.
|