Autor Beitrag
Motoorradengel
Hält's aus hier
Beiträge: 6

Win xp
D7 enterprise
BeitragVerfasst: Mi 26.05.04 16:58 
ich versuche in einer string grid tabelle auf der nullten zeile die vielfache der zahl 3 und auf der nullten reihe die vielfache der zahl 7 einzugeneb nur weiß ich nicht wie das geht kann mir jemand helfen??? zudem hab ich das problem dass ich nciht weiß wie man in dieser tabelle eine reihenfolge eingibt die 1,2,4,8,16,32... und 1024,512,256,124... und außerdem 11,12,13,14,11,12,13,14... kann mir bitte wer helfen wäre super nett danke im vorraus
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 26.05.04 17:27 
Ich vermute mal, dass dir nur der Befehl inttostr() fehlt.
Dann geht das in etwa so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i:=1 to 10 do StringGrid1.Cells(i,3):=inttostr(3*i);
for i:=1 to 10 do StringGrid1.Cells(i,4):=inttostr(7*i);
for i:=1 to 10 do StringGrid1.Cells(i,5):=inttostr(2*i);
for i:=11 to 14 do StringGrid1.Cells(i,6):=inttostr(i);

_________________
We are, we were and will not be.
EUOCheffe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124



BeitragVerfasst: Mi 26.05.04 17:29 
Bei einem StringGrid musst du die einzelnen Zellen zur Laufzeit mit Werten füllen, da es im Objektinspektor keine passende Eigenschaft dafür gibt. Nützliche Eigenschaften:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
TStringGrid:
  property Cells[ACol, ARow: Integer]: string;
  property Cols[Index: Integer]: TStrings;
  property Rows[Index: Integer]: TStrings;
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 26.05.04 18:13 
Auf Wunsch auch noch das mit den 2er Potenzen:
Zum einen gibt es in der Unit Math die Funktion power(), mit der man Exponenten berechnen kann. Es geht aber auch so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
i:=1;
tmp:=1;
repeat
  stringGrid1.Cells(i,5):=inttostr(tmp);
  tmp:=2*tmp;
  inc(i);
until i=11;

Ach ja: Danke für die PN, aber wenn Nachfragen sind: Einfach ins Forum posten. Dann haben alle was davon. :wink:

_________________
We are, we were and will not be.