Autor Beitrag
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Sa 13.10.07 10:46 
Hallo zusammen! Ich programmiere gerade einen Reaktionszeitmesser, und ich habe eine Frage:

Bei diesem Quelltext:

ausblenden volle Höhe 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:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
//---------------------------------------------------------------------------
#include <vcl.h>

#pragma hdrstop



#include "Unit1.h"

#include "Unit2.h"

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma link "CGAUGES"

#pragma resource "*.dfm"

TForm1 *Form1;

Integer Reaktionszeit, Zufall = 1;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

        : TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

   Reaktionszeit = Reaktionszeit + 13;

   Label1->Caption = IntToStr (Reaktionszeit);

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

  if (((Reaktionszeit == 1) || (Reaktionszeit == 13) || (!Timer1->Enabled)))

    Form1->OnClick

  else;

  {

     Button1->Hide();

     Timer1->Enabled = false;

     StartTimer->Enabled = true;

     Form2->Memo1->Lines->Add(IntToStr (Reaktionszeit));

     Reaktionszeit = 0;

     Button1->Hide();

  }

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)

{

  Form2->Show();

}

//---------------------------------------------------------------------------



void __fastcall TForm1::ApplicationEvents1Exception(TObject *Sender,

      Exception *E);



{

  Form2->Hide();

  Form3->ShowModal();

}

//---------------------------------------------------------------------------



void __fastcall TForm1::FormClick(TObject *Sender)

{

  Label1->Caption = "Schummler!";

  Form2->Memo1->Clear();

  Timer1->Enabled = false;

  Sleep (1000);

  StartTimer->Enabled = true;

}

//---------------------------------------------------------------------------







void __fastcall TForm1::Timer2Timer(TObject *Sender)

{

  Timer1->Enabled = true;

  Timer1->Interval = 1;

}

//---------------------------------------------------------------------------



void __fastcall TForm1::StartTimerTimer(TObject *Sender)

{

  Timer2->Enabled = true;

  StartTimer->Enabled = false;

  Button1->Show();

  randomize();

  Zufall = random (2000) + 555;

  Timer2->Interval = Zufall;

}

//---------------------------------------------------------------------------

sagt er mir:
ausblenden Quelltext
1:
2:
3:
4:
5:
    Unit1.cpp (31): E2379 In Anweisung fehlt ;

    Vollständiger Parser-Kontext:

    Unit1.cpp (28): Analyse von void __fastcall TForm1::Button1Click(TObject *)


Hilfe! Ich habe den ganzen Quelltext nach fehlenden Semikolons abgesucht: Ohne Ergebnis

Bitte um Antwort.

Moderiert von user profile iconChristian S.: Topic aus Sonstiges (C# / .NET) verschoben am Sa 13.10.2007 um 11:52
Moderiert von user profile iconUGrohne: Unnötige Zeilenumbrüche entfernt.
Moderiert von user profile iconUGrohne: C#- durch Code-Tags ersetzt.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Sa 13.10.07 11:26 
user profile iconMitmischer 1703 hat folgendes geschrieben:
ausblenden C#-Quelltext
1:
else;					

Gehört sich das so? :?
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: Sa 13.10.07 13:01 
Nope, ist aber syntaktisch korrekt :P

Block-Statements dürfen beliebig gestartet werden, wenn sie Anweisungen zusammenfassen.

ausblenden C#-Quelltext
 
54:
55:
56:
57:
58:
59:
60:
61:
62:
/* ... */
  if (((Reaktionszeit == 1) || (Reaktionszeit == 13) || (!Timer1->Enabled))) {

    Form1->OnClick;

  }

  else

  {


Ansonsten: Überprüfe bitte einmal, ob in der Header-File HINTER der Klassendeklaration
1. ein Zeilenumbruch folgt
2. ein abschließendes Semikolon vorhanden ist.

_________________
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.
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: So 14.10.07 08:03 
Danke, BenBE, klappt!