Ver Mensaje Individual
  #1  
Antiguo 10-05-2022
Avatar de bulc
bulc bulc is offline
Miembro
 
Registrado: jun 2010
Posts: 415
Reputación: 14
bulc Va por buen camino
Se salta el número 10, el 20 y el 21...

Quiero hacer un listado de número sucesivos de dos dígitos (no Integers) hasta el 24 y este modo se salta el 10, el 20 y el 21...
Y no entiendo por qué. No encuentro el error. A ver si alguien me puede ayudar. Gracias.
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
Var
   Sub: String[2];   S : String ;  I: Integer;
begin
Edit1.Clear;
S := ''; Sub := '' ;
for I := 1 to 24 do
begin
    IF I <= 9  then Sub := Format('%.*d', [2,I]) ELSE Sub := InttoStr( I );
    if  POS(Sub, S) = 0 then INSERT( Sub, S, Length(S)+1 ) ;
     //ShowMessage(' FALTAN EL 10, 20 Y EL 21 POR el morro');
end;
Edit1.Text := S ;
end;

Última edición por bulc fecha: 10-05-2022 a las 22:23:39.
Responder Con Cita