Autor Beitrag
somebody
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Fr 09.02.07 10:46 
Ich hab mal sonne Frage, ich kenne mich mit delphi noch nicht so sehr dolle aus, und ich wollte mal fragen was ich falsch mache, ich wollte nämlich für meinen kleinen Bruder ein Vokabelprogramm versuchen, wo angezeigt wird ob er die Vokabel richtig hat.

Ich hab geschrieben:

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:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
unit Unit1; 

interface 

uses 
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
ExtCtrls, StdCtrls, Buttons, Grids, ComCtrls, ColorGrd; 

type 
TForm1 = class(TForm) 
Edit2: TEdit; 
Shape1: TShape; 
Edit5: TEdit; 
Edit6: TEdit; 
Edit8: TEdit; 
Edit10: TEdit; 
Edit1: TEdit; 
Edit3: TEdit; 
Edit4: TEdit; 
Edit7: TEdit; 
Edit9: TEdit; 
Edit11: TEdit; 
Edit12: TEdit; 
Edit13: TEdit; 
Edit14: TEdit; 
Edit15: TEdit; 
Edit16: TEdit; 
Edit17: TEdit; 
Edit19: TEdit; 
Edit20: TEdit; 
Edit21: TEdit; 
Edit22: TEdit; 
Edit18: TEdit; 
Edit23: TEdit; 
Edit24: TEdit; 
Edit25: TEdit; 
StaticText1: TStaticText; 
StaticText2: TStaticText; 
StaticText3: TStaticText; 
StaticText4: TStaticText; 
StaticText5: TStaticText; 
StaticText6: TStaticText; 
StaticText7: TStaticText; 
StaticText8: TStaticText; 
StaticText9: TStaticText; 
StaticText10: TStaticText; 
StaticText11: TStaticText; 
StaticText12: TStaticText; 
StaticText13: TStaticText; 
StaticText14: TStaticText; 
StaticText15: TStaticText; 
StaticText16: TStaticText; 
StaticText17: TStaticText; 
StaticText18: TStaticText; 
StaticText19: TStaticText; 
StaticText20: TStaticText; 
StaticText21: TStaticText; 
StaticText22: TStaticText; 
StaticText23: TStaticText; 
StaticText24: TStaticText; 
StaticText25: TStaticText; 
Button1: TButton; 
Edit26: TEdit; 
Edit27: TEdit; 
Edit28: TEdit; 
Edit31: TEdit; 
StaticText26: TStaticText; 
StaticText28: TStaticText; 
StaticText29: TStaticText; 
StaticText31: TStaticText; 
Shape2: TShape; 
Shape3: TShape; 
Shape4: TShape; 
Shape5: TShape; 
Shape6: TShape; 
Shape7: TShape; 
Shape8: TShape; 
Shape9: TShape; 
Shape10: TShape; 
Shape11: TShape; 
Shape12: TShape; 
Shape13: TShape; 
Shape14: TShape; 
Shape15: TShape; 
Shape16: TShape; 
Shape17: TShape; 
Shape18: TShape; 
Shape19: TShape; 
Shape20: TShape; 
Shape21: TShape; 
Shape22: TShape; 
Shape23: TShape; 
Shape24: TShape; 
Shape25: TShape; 
Shape26: TShape; 
Shape27: TShape; 
Shape28: TShape; 
Shape29: TShape; 
Shape30: TShape; 
procedure Button1Click(Sender: TObject); 
private 
{ Private-Deklarationen } 
public 
{ Public-Deklarationen } 
end; 

var 
Form1: TForm1; 
implementation 

{$R *.DFM} 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
if 
edit2.text :='trouble' 
then 
shape2.brush.color :=clgreen 
end; 

end.


und dann makiert delphi then rot. Was mache ich falsch?
Danke jetzt schon mal für hilfen.

Moderiert von user profile icongausi: Delphi-Tags hinzugefügt.
basti_1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 104

Linux, Win Xp, Win 2000
Delphi, C, C++, PHP,
BeitragVerfasst: Fr 09.02.07 10:49 
Versuchs mal so
ausblenden Delphi-Quelltext
1:
2:
 if  edit2.text :='trouble' then 
shape2.brush.color :=clgreen


oder

ausblenden Delphi-Quelltext
1:
2:
 if  (edit2.text :='trouble') then 
shape2.brush.color :=clgreen



ist auch etwas übersichtlicher

_________________
Wissen ist Macht. Nichts zu Wissen macht auch nichts
basti_1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 104

Linux, Win Xp, Win 2000
Delphi, C, C++, PHP,
BeitragVerfasst: Fr 09.02.07 10:50 
Blödsinn. ICh ahbe den Fehler gefunden
:= ist eine Zuweisung
du willst aber =
also
ausblenden Delphi-Quelltext
1:
2:
 if  edit2.text ='trouble' then 
shape2.brush.color :=clgreen

_________________
Wissen ist Macht. Nichts zu Wissen macht auch nichts
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 09.02.07 10:50 
ausblenden Delphi-Quelltext
1:
2:
if (edit2.text = 'trouble') then 
    shape2.brush.color :=clgreen;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Fr 09.02.07 10:55 
Ah, danke für die vielen hilfen, jetzt geht es jetzt kommt aber das nächste Problem, wie mache ich das öfters?

Ich hab da:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
begin
if
edit2.text ='trouble' then
shape23.brush.color :=clgreen

if
edit10.text ='conference' then
shape2.brush.color :=clgreen
end;

end.


und es geht nicht.

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 09.02.07 11:04 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
begin
if
edit2.text ='trouble' then
shape23.brush.color :=clgreen; //Semikolon fehlte

if
edit10.text ='conference' then
shape2.brush.color :=clgreen
end;

end.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Fr 09.02.07 11:05 
ah, danke ich probier es mal aus


Zuletzt bearbeitet von somebody am Fr 09.02.07 11:06, insgesamt 1-mal bearbeitet
basti_1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 104

Linux, Win Xp, Win 2000
Delphi, C, C++, PHP,
BeitragVerfasst: Fr 09.02.07 11:05 
Ich würde dir empfehlen dei Syntax von Delphi dir anzusehen.

_________________
Wissen ist Macht. Nichts zu Wissen macht auch nichts
somebody Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167
Erhaltene Danke: 2



BeitragVerfasst: Fr 09.02.07 11:08 
jaaaaaaaaaa, jetzt gehts. vielen dank für die hilfen.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 09.02.07 11:10 
user profile iconbasti_1984 hat folgendes geschrieben:
Ich würde dir empfehlen dei Syntax von Delphi dir anzusehen.

Wie wär's hiermit?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot