NR := 0;
IX := 0;
for i:=0 to ListBox1.Items.Count-1 to 0 do
begin
Nr := Nr + StrToIntDef(ListBox1.Items[ListBox1.ItemIndex], 0);
inc(IX);
if IX=22 then
begin
Nr := Trunc(Nr/22);
ListBox2.Items.Add(IntToStr(Nr));
Nr := 0;
IX := 0;
end;
end;
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionvar@+
EndVal, I : Integer;
...
begin
EndVal := StrToIntDef(ListBox1.Items[ListBox1.Items.Count-1],0)div 22;
for I := 0 to EndVal do
ListBox2.Items.Add(Format('%d',[I]));
end;
//ou plus simple
begin
EndVal := ListBox1.GetCount div 22;
//ou => EndVal := ListBox1.Items.Count div 22;
for I := 0 to EndVal do
ListBox2.Items.Add(Format('%d',[I]));
end;
for i:=0 to ListBox1.Items.Count-1 to 0 dova y avoir un ti problème LOL @+
var
r:temp,IX : integer;
begin
temp :=0;
IX :=0;
for r:=0 to ListBox1.Items.Count-1 do
begin
temp:= StrToIntDef(ListBox1.Items.Strings [r],0);
inc(IX);
if IX=22 then
begin
temp:=trunc(temp/22) ;
ListBox2.Items.Add (IntToStr (temp));
temp := 0;
IX :=0;
end;
end;
end;