Autor Beitrag
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Di 08.07.08 07:31 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TForm1.Button1Click(Sender: TObject);
var
lehrer : String ;
Deutsch,erstek,zweitek,drittek,m : Real ;
i : Integer ;
begin
  lehrer  := Edit1.Text ;
  erstek  := StrToFloatDef(edit2.Text,0);
  zweitek := StrToFloatDef(edit3.Text,0);
  drittek := StrToFloatDef(edit4.Text,0);
  m := StrToFloatDef(edit5.Text,0);
  begin
  if RadioButton1.Checked then
    StringGrid1.Cells[1,1]:= FloatToStr(erstek);
    StringGrid1.Cells[2,1]:= FloatToStr(zweitek);
    StringGrid1.Cells[3,1]:= FloatToStr(drittek);
    StringGrid1.Cells[4,1]:= FloatToStr(m);
  end;
  begin
  if RadioButton2.Checked then
    StringGrid1.Cells[1,2]:= FloatToStr(erstek);
    StringGrid1.Cells[2,2]:= FloatToStr(zweitek);
    StringGrid1.Cells[3,2]:= FloatToStr(drittek);
    StringGrid1.Cells[4,2]:= FloatToStr(m);
  end;
end;


Ich wollte die Noten Ausgabe für die Jahre 12.1 und 12.2 über zwei RadioButton lösen, nur wenn ich jetzt die Werte eingebe und das erste checke werden die Werte die eigentlich erst beim 2 gecheckten Button erscheinen sollten gleich mit ins StringGrid übertragen !
Wo liegt da der Fehler...*tired*


LG

GericasS

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 08.07.08 07:38 
Fehlenden begin..ends ?

_________________
Markus Kinzler.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Di 08.07.08 07:51 
Moin Alex!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
procedure TForm1.Button1Click(Sender: TObject);
var lehrer : String ;
    Deutsch,erstek,zweitek,drittek,m : Real ;
    i : Integer ;
begin

  lehrer  := Edit1.Text ;
  erstek  := StrToFloatDef(edit2.Text,0);
  zweitek := StrToFloatDef(edit3.Text,0);
  drittek := StrToFloatDef(edit4.Text,0);
  m := StrToFloatDef(edit5.Text,0);

  //begin //das Begin bringt hier doch nix..raus damit!
  if RadioButton1.Checked then
  begin
    StringGrid1.Cells[1,1]:= FloatToStr(erstek);
    StringGrid1.Cells[2,1]:= FloatToStr(zweitek);
    StringGrid1.Cells[3,1]:= FloatToStr(drittek);
    StringGrid1.Cells[4,1]:= FloatToStr(m);
  end;

  if RadioButton2.Checked then
  begin
    StringGrid1.Cells[1,2]:= FloatToStr(erstek);
    StringGrid1.Cells[2,2]:= FloatToStr(zweitek);
    StringGrid1.Cells[3,2]:= FloatToStr(drittek);
    StringGrid1.Cells[4,2]:= FloatToStr(m);
  end;
end;


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Di 08.07.08 07:54 
:autsch: aua danke euch zweien :wink:

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300