Autor Beitrag
SweeT_C
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 13.03.07 20:50 
Moin,
ich hab ein Programm geschrieben, dass den Flächeninhalt eines Dreiecks berechnet. Allerdings zeigt mir das, sobald die Seitenlängen nicht exact identisch sind die im Titel genannte Fehlermeldung...

Weiß eienr woran es leigen könnte ?

Quelltext:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.BitBtn7Click(Sender: TObject);
var s, a, b, c, d:real;
begin
a:=strtofloat(edit11.text);
b:=strtofloat(edit12.text);
c:=strtofloat(edit13.text);
s:=(a+b+c)/2;
d:=sqrt((s*(s-a)*(s-b)*(s-c)));
label9.Caption:=floattostr(d);


Die Formel ist diese: www.arndt-bruenner.d...e/9/herondreieck.htm

MfG und Thx
SweeT_C
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 13.03.07 20:51 
probier mal die Gleitkommazahlen mit einem Punkt statt eines Kommas einzugeben.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
SweeT_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 13.03.07 20:58 
user profile iconmatze hat folgendes geschrieben:
probier mal die Gleitkommazahlen mit einem Punkt statt eines Kommas einzugeben.

Schon probiert..ich hab das Problem auch bei natürlichen Zahlen, sprich 1; 2; 10; 556 usw...
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 13.03.07 21:06 
Hallo,

fragst du die richtigen Edits ab?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
SweeT_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 13.03.07 21:15 
user profile iconLannes hat folgendes geschrieben:
Hallo,

fragst du die richtigen Edits ab?

ja, habs n paar Mal überprüft
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 13.03.07 21:59 
Hallo,

in welcher Zeile kommt die Fehlermeldung?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
SweeT_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 13.03.07 22:09 
Das Problem hat sich inzwischen erledigt.
Ich habs neu geschrieben und komischerweise funktioniert es jetzt. Fragt mich nciht warum o.O

Danke für eure hilfe ;)