Autor Beitrag
LinzerASK
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 21:01 
source cose (zaheln 1 und 2) rechenoperator "+"

_____________________________________________________

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:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Menus;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Button3: TButton;
    Button14: TButton;
    Button5: TButton;
    MainMenu1: TMainMenu;
    Men1: TMenuItem;
    Infos1: TMenuItem;
    Ende1: TMenuItem;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
    procedure Button10Click(Sender: TObject);
    procedure Button11Click(Sender: TObject);
    procedure Button12Click(Sender: TObject);
    procedure Button14Click(Sender: TObject);
    procedure Ende1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen}
  public
    { Public-Deklarationen}
  end;

var
  Form1: TForm1;
  zahl1:real;

implementation

{$R *.DFM}
{$R WinXPStyle.res}

procedure TForm1.Button1Click(Sender: TObject);
begin
cloSE;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + inttostr(1);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + inttostr(2);
end;

procedure TForm1.Button4Click(Sender: TObject);

begin
zahl1:=strtofloat(Edit1.Text); //zahl1 ist vom Typ real.
Edit1.Clear;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
Edit1.Text:=strtofloat(Edit1.Text)+zahl1;
end;

procedure TForm1.Ende1Click(Sender: TObject);
begin
closE;
end;

end.

____________________________


nur beim button5.click ist der hund drinnen!?was kann ich da machen!? wisst ihr wewiter?!


Zuletzt bearbeitet von LinzerASK am Do 17.11.05 21:15, insgesamt 1-mal bearbeitet
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:04 
einaml posten reicht.
Edit1.Text := Edit1.Text + FloatToStr(Zahl1);

_________________
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.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 17.11.05 21:06 
1. Bitte Delphi-Tags nutzen
2. Bitte konkreter werden
3. Man kann uns hier keinen Source hinklatschen "nun macht mal" ...
This is subject to be posted in the Job-Sparte

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 21:16 
ausblenden Delphi-Quelltext
1:
Edit1.Text := Edit1.Text + FloatToStr(Zahl1);					



das ändert auch nichts, es läuft zwar aber es kommt kein ergebnis raus
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:20 
Willst du rechnen oder willst du was hinten dran hängen?
Wenn du rechnen willst:  Edit1.Text := FloatToStr(StrToFloatEdit3.Text) + Zahl)

greetz

EDIT: Semikolons haben nicht direkt was mit delphi zu tun. Semikolon ist das hier: > ; <

_________________
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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 21:32 
Titel: bei "-"
wie kann ich das jetzt mit -,+,/ machen!?
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:33 
eigendlich genauso.. kannst du dir erschließen ;)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) + Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) - Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) * Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) / Zahl)
;)

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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 21:37 
nein ich meine was gehört in den "-" button reingschrieben...

weil beim plus steht ja

ausblenden Delphi-Quelltext
1:
2:
zahl1:= strtofloat(Edit1.Text);
    Edit1.Clear;


somit kann ich das nicht verstehen
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:40 
Genau das selbe ;)

_________________
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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 21:46 
Titel: ojeoje
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) + Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) - Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) * Zahl)
Edit1.Text := FloatToStr(StrToFloatEdit3.Text) / Zahl)


das dann alles in den "=" button?!?!?!?!?! kopieren oder eher nicht
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:59 
nein, ButtonPlus sieht ungefähr so aus:

ausblenden Delphi-Quelltext
1:
2:
opcode {neue variable - char} := '+';
zahl1 := strToFloat(edit1.text);


dann = klick:

ausblenden Delphi-Quelltext
1:
2:
3:
case opcode of
    '+': edit1.text := floattostr(zahl1 + strtofloat(edit1.text));
// u.s.w. mit - un so


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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 22:08 
gut ,....das geht einmal +,-,* und / aber jetzt ist die frage mit einem koma....! einfach so wie bei einem plus button programmieren!? oder gibts da wieder einen speziellen befehl!!!!


Zuletzt bearbeitet von LinzerASK am Do 17.11.05 22:14, insgesamt 1-mal bearbeitet
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 22:14 
ja mach mal

_________________
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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 22:15 
gut ,....das geht einmal +,-,* und / aber jetzt ist die frage mit einem koma....! einfach so wie bei einem plus button programmieren!? oder gibts da wieder einen speziellen befehl!!!!
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 22:17 
user profile iconLinzerASK hat folgendes geschrieben:
gut ,....das geht einmal +,-,* und / aber jetzt ist die frage mit einem koma....! einfach so wie bei einem plus button programmieren!? oder gibts da wieder einen speziellen befehl!!!!


Zeig mir doch einfach was du schon für einen ansatz hast?

_________________
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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 22:20 
oke


Zuletzt bearbeitet von LinzerASK am Do 17.11.05 22:29, insgesamt 1-mal bearbeitet
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 22:23 
Ich sehe hier keinenansatz mit einem Komma, aber für einen Anfängertaschenrechner sollte edit1.text := edit1.text + ',' reichen

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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 22:31 
mit dem gehts auch ja ...!

was könnte ich da jetzt noch so programmieren?!

sin,cos und tan müsste man eigetnlich so wie +,-,* und / programmieren odeR?!


wobei wurzelrechnen auch edel wäre, da beim windows rechner so und so keine wurzel vorhanden isT!!!!
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 22:33 
befor du so etwas machst solltest du erst mal sachen verhindern wie x / 0 oder 5,,,,,,,4 etc..

_________________
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.
LinzerASK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

WIN XP
Delphi 4, Delphi 2005
BeitragVerfasst: Do 17.11.05 22:36 
ja gut das kann man eigentlich mit enabled:=false umgehen, doch schaut es mit den grauen ziffern nicht so toll aus!

glaubst du gibts eine möglichkeit das edit feld nur für zahlen freizugeben, sprich die tasten A-Z und sonderzeichen sind gesperrt!?