Autor Beitrag
xus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Do 17.11.05 20:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.sqrtClick(Sender: TObject);
var a :integer ;
     c :real ;
begin
a:=strtoint(edit1.text);
if a > 0 then c:=sqrt(a);   //  <------ hier kackt er immer ab weis nit warum
edit3.text:=floattostr(c);
end;


wieso?

mfg

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 17.11.05 21:02 
Benutz doch mal delphi tags ([ delphi] und [/delphi])
Fehlermeldung?

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
xus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Do 17.11.05 21:04 
user profile iconBorn-to-Frag hat folgendes geschrieben:
Benutz doch mal delphi tags ([ delphi] und [/delphi])
Fehlermeldung?


error missing operator or semilocation
error could not compile unti1.pas
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 17.11.05 21:08 
Also in dem Code da oben ist es soweit richtig wie ich das sehe. Hast du in deinem Originalcode auch alle Semikolons gesetzt?

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
xus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Do 17.11.05 21:16 
user profile iconBorn-to-Frag hat folgendes geschrieben:
Also in dem Code da oben ist es soweit richtig wie ich das sehe. Hast du in deinem Originalcode auch alle Semikolons gesetzt?


was sind Semikolons? ich bin noch n newbie ^^ also hab ich nicht so viel ahnung aber bei allen andren rechoptionen hats geklappt nur bei der nit.

da schau:
ausblenden volle Höhe 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:
30:
31:
32:
33:
34:
35:
36:
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c :real;
begin
 a:=strtofloat(edit1.text) ;
 b:=strtofloat(edit2.text)  ;
c:= a+b                     ;
edit3.Text:=floattostr(c)  ;
end;

procedure TForm1.Button2Click(Sender: TObject);
var a,b,c :real;
begin
 a:=strtofloat(edit1.text) ;
 b:=strtofloat(edit2.text)  ;
c:= a-b                     ;
edit3.Text:=floattostr(c)  ;
end;

procedure TForm1.Button3Click(Sender: TObject);
var a,b,c :real;
begin

 a:=strtofloat(edit1.text) ;
 b:=strtofloat(edit2.text)  ;
c:= a*b                     ;
edit3.Text:=floattostr(c)         ;
end;

procedure TForm1.Button4Click(Sender: TObject);
var a,b,c :real;
begin
 a:=strtofloat(edit1.text) ;
 b:=strtofloat(edit2.text)  ;
c:= a/b                  ;
edit3.Text:=floattostr(c)  ;
end;


nur bei wurzel spinnt er total mfg

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 17.11.05 21:18 
vereinfache es doch einfach in eine Zeile: Edit3.Text := FloatToStr(Sqrt(StrToFloat(Edit3.Text)));

greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Do 17.11.05 21:18 
xus du sollst nicht in der PAS (also dem delphi project)
[ delphi]
[/ delphi]

benutzen sondern hier im forum, damit man den quellcode ordentlich lesen kann

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
xus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Do 17.11.05 21:57 
user profile iconBorn-to-Frag hat folgendes geschrieben:
vereinfache es doch einfach in eine Zeile: Edit3.Text := FloatToStr(Sqrt(StrToFloat(Edit3.Text)));

greetz



danke es hat geklappt!!!!!

ausblenden Delphi-Quelltext
1:
ja ich machs					


mfg