Autor Beitrag
Florian.K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

Win Xp Prof. & SP 2
Delphi 10 Lite
BeitragVerfasst: Do 09.02.06 22:30 
Hier kann man euch ja teils schon beim chatten zuschauen =)
Florian.K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

Win Xp Prof. & SP 2
Delphi 10 Lite
BeitragVerfasst: Do 09.02.06 23:55 
Es funktioniert gut,jetzt fragt mein Sohn mich ob ich das auch in 2erSchritten machen kann.
bsp. 100 98 96 ,
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Var zaehlwert:Integer;
begin
For zaehlwert:=100  Downto 1 do
begin
listbox.Items.add (IntToStr(zaehlwert));
Listbox.refresh ;

Ich habe versucht es auf -1 zu stellen jeweils. Ich komme nicht auf die Lösung.

"Hat sich erledigt ich habs " aber vllt hat ja jemand ne einfachere Lösung. Ich hab jetzt nur ungerade Zahlen nicht anzeigen reinprogrammiert.


Zuletzt bearbeitet von Florian.K am Fr 10.02.06 00:17, insgesamt 1-mal bearbeitet
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Fr 10.02.06 00:10 
Dafür musst du dann die while Schleife bemühen weil for nur in einer Schritten Zählt
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  i: Integer;
begin
  i := 100;
  while i > 0 do begin
    Listbox.Items.add(IntToStr(i));
    dec(i,2);
    Listbox.Refresh ; 
  end;

(ungetestet)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 10.02.06 00:17 
Ich Denke mal Du und dein Sohn habt noch etwas vor Euch !!!
zb.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.Button1Click(Sender: TObject);
var
 i:integer;
begin
  i:=0;
 repeat
  inc(i,2);{Um 2 höherzählen}
  Listbox1.Items.Add(IntToStr(i));
 until i >=100{Prüfen das auch wirklich 100 rauskommt sonst abruch größer 100 sonst Endlos Schleife...}
end;

{for schleife um 2 höherzählen}

procedure TForm1.Button1Click(Sender: TObject);
var
i,j:Integer;
begin
  for i := 1 to 100 div 2 do
 begin
  Listbox1.Items.Add(IntToStr(i*2));
 end;
0xCC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 150



BeitragVerfasst: Fr 10.02.06 00:24 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 for i := 1 to 100 do   
 begin   
   inc(pinteger(@i)^);
   Listbox1.Items.Add(inttostr(i));   
 end;
Florian.K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

Win Xp Prof. & SP 2
Delphi 10 Lite
BeitragVerfasst: Fr 10.02.06 00:45 
Spitzen Community hier muss ich schonmal sagen =).