Autor Beitrag
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 16.10.05 14:43 
Kommt schon Mädels. Das ist nicht die "Jobbörse". Davon abgesehen mach ichs umsonst in maximal 2 Minuten. Mit Fehlerabfrage vielleicht in 5. Aber dadurch lernt TigerKath nix.

Also: Beim Thema bleiben. Jeder hat mal klein angefangen.

_________________
We are, we were and will not be.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: So 16.10.05 14:46 
Gausi: Spielverderber :schmoll:

_________________
Na denn, dann. Bis dann, denn.
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 14:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function FolgeAn(n:integer):integer;
var
  Form1: TForm1;

implementation

{$R *.dfm}
function FolgeAn(n:integer):integer;
begin
Result:=((8 * n) + 2) / ((n * n) + 1);
end;

procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:integer;
begin
Ergebnis:=FolgeAn(2);
end;

end.




//WO IST DANN DA DER FEHLER, WEIL ES FUNKT NICHT?????

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 16.10.05 15:01 
Woher weiss die Functuion was n ist !
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: So 16.10.05 15:02 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
var
  Form1: TForm1;

implementation

{$R *.dfm}
function FolgeAn(n:integer):real;
begin
Result:=((8 * n) + 2) / ((n * n) + 1); //bei Integer nimm div
end;                                   //für real nimm /  

procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:real;
begin
Ergebnis:=FolgeAn(2);
end;

end.

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: So 16.10.05 15:05 
user profile iconBlackheart666 hat folgendes geschrieben:
Woher weiss die Functuion was n ist !

WEIL ES IN DR DEKLARTION STEHT :lol:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 15:06 
So also:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
 function FolgeAn(n:integer):integer;
var
  Form1: TForm1;

implementation

{$R *.dfm}
function FolgeAn(n:integer):integer;
begin
Result:=((8 * n) + 2div ((n * n) + 1);
end;

procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:integer;
begin
Ergebnis:=FolgeAn(2);
end;

end.


Doch wo wird das ausgeben...das Ergebnis, wie definier ich das?

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 16.10.05 15:09 
Stimmt hats nur überflogen zwecks, function vorne weg mein Fehler. Man sollte auch richtig Lesen.
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 15:09 
ich dachte in die klammer muss eine zahl rein...die dann n sein solll!
Oder wie soll ich das definieren
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 16.10.05 15:10 
Das Ergebnis in einem Edit anzeigen geht so: Edit1.Text := IntToStr(Ergebnis); Einfach nach der Berechnung von Ergebnis diese Zeile einfügen. Vorher natürlich noch ein Edit auf die Form packen

_________________
We are, we were and will not be.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: So 16.10.05 15:12 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:integer;
begin
Ergebnis:=FolgeAn(2);
  Panel1.Caption := FloatToStr(Ergebnis);
end;

wenn du ein Panel auf die Form ziehst!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!


Zuletzt bearbeitet von Kroko am So 16.10.05 15:15, insgesamt 1-mal bearbeitet
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 15:12 
nicht lieber panelcaption also
Panel1.Caption := IntToStr(Ergebnis);
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 15:20 
ES FUNKTIONIERT, DOCH ICH BRÄUCHTE DAS PROGRAMM NICHT MIT INTEGER SONDERN
EXTENDED. DOCH WENN ICH STATT INTEGER EXTENDED EINSETZE DANN FUNKT ES NICHT.WIE SOLL
ICH DAS ÄNDERN????

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function FolgeAn(n:Integer):Integer;
var
  Form1: TForm1;

implementation

{$R *.dfm}
function FolgeAn(n:Integer):Integer;
begin
Result:=((8 * n) + 2div ((n * n) + 1);
end;

procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:Integer;
begin
Ergebnis:=FolgeAn(3);
Panel1.Caption := IntToStr(Ergebnis); 
end;

end.


Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt. Hinweis: Quellcode bitte mit [delphi]...[/delphi] einschliessen
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: So 16.10.05 15:24 
Mach aus dem Integer ein extended

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function FolgeAn(n:extended):extended;
var
  Form1: TForm1;

implementation

{$R *.dfm}
function FolgeAn(n:extended):extended;
begin
Result:=((8 * n) + 2) / ((n * n) + 1);
end;

procedure TForm1.Button1Click(Sender: TObject);
var Ergebnis:Extended;
begin
Ergebnis:=FolgeAn(3);
Panel1.Caption := FloatToStr(Ergebnis); // Das Float statt int weil Float für gleitkomma werte steht.
end;

end.


und bitte schrei nicht so rum ;)


Zuletzt bearbeitet von DarkHunter am So 16.10.05 15:25, insgesamt 2-mal bearbeitet
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 16.10.05 15:24 
FloatToStr(); statt IntToStr();

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
TigerKath Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 16.10.05 15:32 
ok vielen dank programm läuft ich habs verstanden und es macht jetzt richtig viel spaß dich ich noch weiter eifrig programmiere und da bin ich wieder auf ein problem gestoßen...guckt euch das mal an...was ich falsch gemacht hab und sagt es mir bitte...danke!

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:
 function Zahlbeschreinbung(x:Integer):Integer;
var
  Form1: TForm1;

implementation

{$R *.dfm}


function Zahlbeschreinbung(x:Integer):Integer;
begin
 if x<0 then
 Result:='negativ';
 if x>0 then
 Result:='positiv';
 if x=0 then
 Result:='null';
end;
 
procedure TForm1.Button1Click(Sender: TObject);

var Ergebnis:Integer;
 begin
 Ergebnis:= Zahlbeschreinbung(6);
end;

end.


Moderiert von user profile iconGausi: Wieder mal aufgeräumt.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 16.10.05 15:37 
So. Hier mach ich jetzt auch dicht. Pro Thread bitte nur eine Frage. Hier ist schon genug Durcheinander. Wenn jetzt auch noch der Unterschied zwischen Integern und Strings kommt...ne. ;-)

* closed *

_________________
We are, we were and will not be.
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.