Autor Beitrag
bonanza
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 13.11.05 12:05 
Hi

warum geht das nicht ?

c_k ist eine Checkbox

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button1Click(Sender: TObject);
var y: Integer;
begin
if (c_k.Checked) then (y := 1);
end;


es kommt der fehler:

[Fehler] E2029 ')' erwartet, aber ':=' gefunden


danke schonmal im voraus

boanza
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: So 13.11.05 12:08 
schreib das (y := 1) mal ohne Klammer

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
bonanza Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 13.11.05 12:09 
danke das wars...
super schnelle hilfe thx !!
bonanza Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 13.11.05 12:28 
hi,
ich hab direkt noch eine frage..
wie mache ich eine verknüpfung von if bedingungen also
wenn a=0 und b=0 dann y:=1

danke schonmal im voraus
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 13.11.05 12:33 
ausblenden Delphi-Quelltext
1:
if (a=0) AND (b=0) then y := 1					

Hier sind die Klammern wichtig.

Für weitere Fragen empfehle ich Crashkurs Delphi

_________________
We are, we were and will not be.
qwerdenker
Hält's aus hier
Beiträge: 7



BeitragVerfasst: So 13.11.05 16:34 
und wie kann man 2 then verknüpfungen machen also so dass man halt so etwas hat:
wenn dies ist dann mach das und das!
bei mir kommt da immer ein fehler :Operator ist auf diesen Operandentyp nicht anwendbar
hoffe ihr wisst was ich mein :-)
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: So 13.11.05 16:38 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if (a=0) AND (b=0) then 
begin
y:=0;//du das
y:=1;//und dies
end;


so..

_________________
GEIZ IST GEIL! - Ihr Sozialamt


Zuletzt bearbeitet von starsurfer am So 13.11.05 16:39, insgesamt 1-mal bearbeitet
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 13.11.05 16:39 
Crashkurs Delphi
und
Delphi Source

Bitte mal ansehen.
Danke...

ansonsten: nur eine frage pro thread.

danke!

ps: guck mal nach begin und end!!!

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
qwerdenker
Hält's aus hier
Beiträge: 7



BeitragVerfasst: So 13.11.05 16:44 
user profile iconstarsurfer hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if (a=0) AND (b=0) then 
begin
y:=0;//du das
y:=1;//und dies
end;


so..


stimmt, das hab ich nun auch hinbekommen aber da ich noch ein else drinhab und vor dem else kein ";" stehen darf wird das end nicht angenommen
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: So 13.11.05 16:46 
das programm sagt dir doch was es nicht haben will :wink:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if (a=0) AND (b=0) then   
begin  
y:=0;//du das  
y:=1;//und dies  
end//vor else darf kein ";" hin,aber ein "end" darf hin 
  else
begin
x:=0;//du das  
x:=1;//und dies  
end;

_________________
GEIZ IST GEIL! - Ihr Sozialamt