Autor Beitrag
klezmor
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Fr 28.04.06 21:36 
Wenn ich kompilieren will kommt immer folgende Meldung: expected ";" but found "."
in der Zeile der Fehlermeldung steht das: procedure TForm1.FormCreate(Sender: TObject);
Weiß absolut nicht an was das liegen könnte, aber ich denke es ist irgendein banaler fehler, der mich viel zeit kostet, kann mir bitte irgendjemand schnellstmöglich helfen?


Moderiert von user profile iconGausi: Topic aus VCL (Visual Component Library) verschoben am So 30.04.2006 um 13:54

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 28.04.06 21:41 
Fehlt irgendwo ein ';'?

_________________
Markus Kinzler.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 28.04.06 21:47 
Wie wärs mit ein bisschen Code?

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Fr 28.04.06 22:08 
Das bedeutet, dass irgendwo vor dieser Zeile ein abschließendes ";" fehlt, mehr net, ansonsten: mehr Source wär echt praktisch :roll:
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Fr 28.04.06 22:11 
evlt fehlt auch ein ganzes "end;" ;)
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 00:18 
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:
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:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, GradBtn_Ex, ExtCtrls, SRGrad, StdCtrls;

type
  TForm1 = class(TForm)
    ScrollBox1: TScrollBox;
    Image1: TImage;
    GradBtn_Ex1: TGradBtn_Ex;
    SRGradient1: TSRGradient;
    Shape2: TShape;
    Label1: TLabel;
    ListBox1: TListBox;
    Label2: TLabel;
    Edit1: TEdit;
    Label3: TLabel;
    Edit2: TEdit;
    Label4: TLabel;
    Edit3: TEdit;
    Label5: TLabel;
    Edit4: TEdit;
    GradBtn_Ex3: TGradBtn_Ex;
    GradBtn_Ex4: TGradBtn_Ex;
    Edit5: TEdit;
    Label6: TLabel;
    Label7: TLabel;
    Edit6: TEdit;
    Label8: TLabel;
    Edit7: TEdit;
    ComboBox1: TComboBox;
    Label9: TLabel;
    Label10: TLabel;
    ComboBox2: TComboBox;
    GradBtn_Ex2: TGradBtn_Ex;
    procedure FormCreate(Sender: TObject);
    procedure GradBtn_Ex2Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure GradBtn_Ex1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const border_sidewards:integer= 40;
      border_upwards:  integer= 40;

var
  Form1: TForm1;
  values: array of real;
implementation

procedure plotfunction(const yn,r:extended;const range,streckx,strecky:integer);

{$R *.dfm}


procedure checkinput(const y0,r,streckx,strecky,range:string);
var Py0,pr:extended; pstreckx,pstrecky,prange:integer;
begin
 py0:=strtofloat(y0);
 pr:=strtofloat (r);
 pstreckx:=strtoint(streckx);
 pstrecky:=strtoint(strecky);
 prange:=strtoint(range);

 if ((py0<=0) or (py0>1)) then begin showmessage('Geben sie bitte eine Zahl zwischen 0 und 1 ein'); exit; end;
 if ((pr<=0) or (pr>4.3)) then begin showmessage('Geben sie bitte eine Zahl zwischen 0 und 4.3 ein'); exit; end;
 if ((pstreckx<=0) or (pstreckx>1000)) then begin showmessage('Geben sie bitte eine Zahl zwischen 0 und 1000 ein'); exit; end;
 if ((pstrecky<=0) or (pstrecky>1000)) then begin showmessage('Geben sie bitte eine Zahl zwischen 0 und 1000 ein'); exit; end;
 if ((prange<=0) or (prange>1000)) then begin showmessage('Geben sie bitte eine Zahl zwischen 1 und 1000 ein'); exit; end;

 plotfunction(py0,pr,prange,pstreckx,pstrecky);

end;


function logistic_equation (const yn, factor:real):real;
begin
 result:=factor*yn*(1-yn);
end;

procedure setValues(const n:integer; const y0,factor:extended);
var yn:real; counter:integer;
begin

 SetLength(values,n);
 values[0]:=y0;
 yn:=y0;

 for counter:=1 to n-1 do
 begin
 yn:=logistic_equation(yn,factor);
 values[counter]:=yn;
 end;

end;


procedure plotfunction(const yn,r:extended;const range,streckx,strecky:integer);

const color: array[0..6]of tcolor=
     (clblack,clred,clgreen,clblue,clmaroon,clpurple,claqua);

var counter,i,startpixel:integer;
begin
  I:=0;
  setvalues(range,yn,r);

  counter:=0;
  with form1.image1 do
  begin

   startpixel:=round(Height-border_upwards-(values[0]*strecky));
   canvas.moveto(border_sidewards,startpixel);

   canvas.pen.color:=color[2];

    while (counter<= range)  do
    begin
      inc(i);
      inc(counter,streckx);

      canvas.lineto(counter+border_sidewards,round(Height-border_upwards-strecky*values[i]));
      canvas.moveto(counter+border_sidewards,round(Height-border_upwards-strecky*values[i]));
      (*with Image1 do begin
      Canvas.Brush.Color := clRed;
      Canvas.Brush.Style := bsDiagCross;
      Canvas.Ellipse(0, 0, Image1.Width, Image1.Height);
      end;
      *)

      (*canvas.Pixels[counter+ursprung.x,ursprung.y-1]:=clblack;
       canvas.Pixels[counter+ursprung.x,ursprung.y-2]:=clblack;
       canvas.Pixels[counter+ursprung.x,ursprung.y-0];
       *)

     //application.ProcessMessages;
    end;

  end;
    //inc(farb_index);
end;

procedure plotaxis;
begin
 with form1 do
 begin
 image1.Canvas.Pen.Width:=2;
 //xAchse
 image1.Canvas.MoveTo(border_sidewards,image1.Height-border_upwards);
 image1.Canvas.LineTo(image1.Width-border_sidewards,image1.Height-border_upwards);
 //yAchse
 image1.Canvas.MoveTo(border_sidewards,image1.Height-border_upwards);
 image1.Canvas.LineTo(border_sidewards,round(image1.Height-border_upwards-scrollbox1.height+2.5*border_upwards));
 image1.Canvas.pen.Width:=1;
 end;

end;
procedure TForm1.FormCreate(Sender: TObject);
begin
 form1.DoubleBuffered:=true;
 plotaxis;
end;

procedure TForm1.GradBtn_Ex2Click(Sender: TObject);
var i:integer;
begin
 checkInput(form1.edit1.Text,form1.edit2.Text,edit3.Text,edit4.Text);
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
 scrollbox1.VertScrollBar.Position:=scrollbox1.VertScrollBar.Position+scrollbox1.VertScrollBar.Range;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  shape2.Left:=x;
end;

procedure TForm1.GradBtn_Ex1Click(Sender: TObject);
var i:integer;
begin
 setvalues(10000,0.8,3.9);
 for i:=0 to length(values)-1 do
 begin
 listbox1.Items.Add(floattostr(values[i]));
 end;

end;

end.



so das ist mein ganzer code hoffe das hilft ein wenig

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 00:24 
Das kann echt nicht sein ich habe alles überprüft und finde einfach keinen fehler

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
andras
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 460

Win XP, Win Vista Home Premium, Ubuntu Dapper Drake
Delphi 2005 Pers
BeitragVerfasst: Sa 29.04.06 00:28 
probier das mal: schreib einfach einmal ein end; vor das end. weiß zwar nicht was da falsch läuft aber vl gets...
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 00:30 
ne funzt leider auch nicht, aber falls das was bringen sollte, eine Zeile später kommt noch ne fehlermeldung, nämlich identifier redeclared tform1

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
andras
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 460

Win XP, Win Vista Home Premium, Ubuntu Dapper Drake
Delphi 2005 Pers
BeitragVerfasst: Sa 29.04.06 00:41 
gut die zweite kann ich mir galub ich erklären: die procedure formcreate ist bereits vordefiniert. man kann dann zwar eigenen code hinzufügen, wie das geht weiß ich aber wirklich nicht.
wozu brauchst du diese procedure überhaupt? sie wird später e nicht mehr aufgerufen...
hast du vl oncreate gemeint?
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 00:46 
ach die on create ist mir ja egal ich will nur das das prog jetzt endlich läuft, aber ich weiß nicht wieso da aufeinmal immer die angesprochene Fehlermeldung erscheint völlig sinnlos, wieso nur?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Sa 29.04.06 07:16 
Das abschließende 'end' der Prozedure plotFunction fehlt, und zwar muss das, schätze ich, direkt vor das 'Procedure TForm1.FormCreate'.

_________________
Na denn, dann. Bis dann, denn.
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 10:20 
leider kommt die fehlermedlung immer noch

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 10:25 
das kommt übrigens bei jeder formmethode, da steht immer ; expected but . found

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 29.04.06 10:29 
user profile iconklezmor hat folgendes geschrieben:
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:
28:
29:
30:
unit Unit1;
...
var
  Form1: TForm1;
  values: array of real;
implementation

procedure plotfunction(const yn,r:extended;const range,streckx,strecky:integer);


{$R *.dfm}


procedure checkinput(const y0,r,streckx,strecky,range:string);
var Py0,pr:extended; pstreckx,pstrecky,prange:integer;
begin
...


...
procedure plotfunction(const yn,r:extended;const range,streckx,strecky:integer);

const color: array[0..6]of tcolor=
     (clblack,clred,clgreen,clblue,clmaroon,clpurple,claqua);

var counter,i,startpixel:integer;
begin
  I:=0;
  setvalues(range,yn,r);

...


Wenn mich nicht alles täuscht: So wie das hier steht sind alle prozeduren unterhalb des markierten teils unterfunktionen von plotfunction. die plotfunktion wird aber nicht mit einem end; abgeschlossen. das dürfte der fehler sein (denke ich zumindest)

die plotfunction wird unten irgendwo implementiert.
der markierte teil sollte wohl entsprechend VOR "implementation" kommen

_________________
Delphi: XE - OS: Windows 7 Professional x64


Zuletzt bearbeitet von Horschdware am Sa 29.04.06 10:32, insgesamt 1-mal bearbeitet
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 10:32 
Ah ok wo muss ich diese Funktionsdeklaration dann hinschreiben?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 29.04.06 10:35 
Vielen vielen Dank endlich habe ich dieses kleine aber sehr anstrengende Problem gelöst.

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 29.04.06 10:35 
wenn du die glboal lassen willst, dann lass einfach das erste "plotfunction" weg.
denk dann aber daran, dass prozeduren und funktionen die im quelltext VOR der implementation von "plotfunction" stehen diese dann noch nicht kennen. in diesem fall musst du dann evtl deinen quelltext leicht umstrukturieren (von der reihenfolge her).

ODER: du machst plotfunction zu einer methode von TForm1, was zwar nicht unbedingt sehr schön ist aber auch funktioniert (je nachdem: hat plotfunction etwas mit form1 zu tun? - nebensache -)

es würde aber auf beide arten funktionieren

_________________
Delphi: XE - OS: Windows 7 Professional x64