Me pueden decir por que este codigo no me funciona?.
La parte donde valido si el caracter esta en un conjunto no se ejecuta, por que puede ser?
Código Delphi
[-]
var
vLetras_Up_Set: set of 'A'..'Z';
vLetras_Low_Set: set of 'a'..'z';
vNum_Set: set of '0'..'9';
vActChar: Char;
vX, vComplejidad: Integer;
vLetraMinContada, vLetraMayuscContada, vNumeroContado, vSimboloContado: Boolean;
begin
if edt_new_pass_show.Text = '' then
Exit;
edt_new_pass.Text := edt_new_pass_show.Text;
vComplejidad := 0;
vLetraMinContada := False;
vLetraMayuscContada := False;
vNumeroContado := False;
vSimboloContado := False;
for vX := 1 to Length(edt_new_pass_show.Text) do
begin
vActChar := edt_new_pass_show.Text[vX];
if (vActChar in vLetras_Up_Set) and not vLetraMayuscContada then
begin
ShowMessage('Se conto una mayuscula');
Inc(vComplejidad);
vLetraMayuscContada := True;
end
else
if (vActChar in vLetras_Low_Set) and not vLetraMinContada then
begin
Inc(vComplejidad);
vLetraMinContada := True;
end
else
if (vActChar in vNum_Set) and not vNumeroContado then
begin
Inc(vComplejidad);
vNumeroContado := True;
end
else
if not vSimboloContado then
begin
ShowMessage('Se conto un simbolo');
Inc(vComplejidad);
vSimboloContado := True;
end;
end;
if Length(edt_new_pass_show.Text) < 8 then
vComplejidad := 1
else
Inc(vComplejidad);
case vComplejidad of
1: lb_complejidad.Caption := 'Complejidad: Extremadamente insegura';
2: lb_complejidad.Caption := 'Complejidad: Poco segura';
3: lb_complejidad.Caption := 'Complejidad: Segura';
4: lb_complejidad.Caption := 'Complejidad: Muy Segura';
5: lb_complejidad.Caption := 'Complejidad: Extremadamente segura';
end;
end;