Autor Beitrag
Pankower_92
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 31



BeitragVerfasst: Do 11.10.07 10:23 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button11Click(Sender: TObject);

var q : single;
    a : single := (StrToFloat(edit22.text));
begin
  q := StrToFloat(edit22.text) power(a,2) / StrToFloat(edit21.text);
  Label19.caption := format('P =  %.5f Watt',[q]);
end;



Guten Morgen,

Ich hab mal ne fragen. Also, wenn ich auf F9 Drücke um das programm zu testen dann sagt er mir immer in der variable fehlt was oder musswas geändert sein.

Ich würde mich sehr freuen wenn ihr mir helfen würdet!!


MFG

Pankower_92

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Moderiert von user profile iconGausi: Topic aus Off Topic verschoben am Do 11.10.2007 um 11:28
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: Do 11.10.07 10:29 
So sollte es besser gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Button11Click(Sender: TObject); 

var q, a : single;      
begin 
  a := (StrToFloat(edit22.text));
// Die Zeile ist noch Murks - was willst du da denn ausrechnen?
  q := StrToFloat(edit22.text) power(a,2) / StrToFloat(edit21.text); 
  Label19.caption := format('P =  %.5f Watt',[q]); 

end;

_________________
We are, we were and will not be.


Zuletzt bearbeitet von Gausi am Do 11.10.07 10:31, insgesamt 1-mal bearbeitet
Pankower_92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 31



BeitragVerfasst: Do 11.10.07 10:30 
ok danke