Autor Beitrag
Grizu66
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Fr 03.10.08 17:17 
Ich schreibe gerade ein Statistikprogramm, welches Daten aus der Com-Schnittstelle auswertet. Hat auch funktioniert. Plötlich gibt der Compiler folgende Meldung aus:

ausblenden Quelltext
1:
[Pascal Error] FM_main.pas(499): E2066 Missing operator or semicolon					



Hier mal der Quelltext:

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:
{---Grid ausfüllen und Statistikdaten ermitteln--------------------------------}
procedure Tmain.GridrefreshTimer(Sender: TObject);
var
pathname : string;
f,f1 : Textfile;
s,sa, sb, datestamp, timestamp, barcode : string;
a, i, index, gr, nr, obj, laenge, position, position1 : integer;
gr_p, nr_p : real;

begin
a := 1;
i := 3;
index := 1;
gr := 0;
nr := 0;
obj:= 0;
pathname := filepath.Text;

if not FileExists(pathname) then begin
AssignFile(f, pathname);
ReWrite(f);
CloseFile(f);
end;


if single.Checked = true then begin
  if Grid1.ColCount >= 3 then begin
  databox.Lines.SaveToFile(pathname);
  AssignFile(f1, pathname);
  reset(f1);__________________________________________________________hier kommt die Fehlermeldung. Line 499
     while not eof(f1) do begin
     readLn(f1, s);
     datestamp := Copy(s,1,10);
     Grid1.Cells[0,a] := InttoStr(Index);
     Grid1.Cells[1,a] := datestamp;


     laenge := Length(s);
     Position := Pos('-->',s);
     Position1 := Pos(';',s);
     Grid1.Cells[2,a] := Copy(s,Position1 + 1, position-position1-1);
     Grid1.Cells[i,a] := Copy(s,Position + 3, laenge-position);
     a := a + 1;
     index := index + 1;



               if runstat.Caption = 'running' then begin
               barcode := Copy(s,Position + 3, laenge-position);
               obj := obj + 1;
               objects.Caption := IntToStr(obj);
                 if barcode = noread.Text then begin
                 nr := nr +1;
                 nr2.Caption := IntToStr(nr);
                 end;

                 if (barcode <> noread.Text) and (barcode <> '') then begin
                 gr := gr +1;
                 gr2.Caption := IntToStr(gr);
                 end;

              nr_p := 100/obj * nr;
              STR(nr_p:3:2, sa);
              nr1.Caption := sa +'%';

              gr_p := 100/obj * gr;
              STR(gr_p:3:2, sb);
              gr1.Caption := sb +'%';

              combi1.Caption := gr1.Caption;;
              combi2.Caption := inttostr(gr);

              end;

     end;
  CloseFile(f1);
  end;
end;



end;




Wer kann mir da helfen?????

Moderiert von user profile iconAXMD: Code- und Delphi-Tags hinzugefügt
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 03.10.08 17:23 
Könntest Du mal Delphi-Tags drumrumsetzen? Dann kann man das besser lesen und auch den Fehler schneller finden.
Grizu66 Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Fr 03.10.08 17:38 
Konnte den fehler mit einer Backup-version aus der history beheben. Weiß aber immer noch nicht woran es gelegen hat.

Habe zuerst nur das procedure aus einer älteren Version kopiert und den gleichen fehler erhalten. Erst als ich die ganze Unit ersetzt habe hat es wieder funktioniert. Der Fehler muss wohl woanders liegen.


Ich würde aber gerne wissen, wie ich die Delphi Tags mit einbringen kann, damit ich in Zukunft meine Anfragen präziser einstellen kann. (Vielen dank für den hinweis)
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 03.10.08 17:52 
[delphi]Quelltext[/delphi]
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Fr 03.10.08 17:53 
Du hast im Beitragseditor oben den Link "Bereiche". Da klickst du drauf, wählst gegebenenfalls "Delphi" aus und klickst auf das +. Dann kopierst du den Quelltext, danach nochmal +. Alternativ schreibst du einfach vornedran "[_delphi_]" und dahinter "[_/delphi_]". (Ohne die Unterstriche und Anführungszeichen; das hab ich jetzt nur gemacht damit der Parser es nicht erkennt.)
Dann sieht der Quelltext viel besser lesbar aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
{$APPTYPE CONSOLE}
program test;
uses Dialogs;
var foo : String;
begin
Readln(foo);
Writeln(foo);
ShowMessage(IntToStr(StrToIntDef(foo,1)+1));
end.


EDIT: Verdammt, zu spät. DeddyH: Wie hast du den Parser dazu gebracht, die Tags zu ignorieren?

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 03.10.08 17:58 
Unter "Optionen": "BBCode in dieser Nachricht deaktivieren" ;)
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Fr 03.10.08 18:09 
Hi,

Und, wenn man an anderer Stelle Tags braucht? Bei Christian(glaube ich) habe ich letztens mal gesehen, dass man den Parser auch durch Ein- und Ausschalten anderer Tags kurzschließen kann:

[del[b][/b]phi][/del[b][/b]phi] (hier habe ich jetzt nochmal die bolt-Tags zusätzlich kurzgeschlossen

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Fr 03.10.08 18:19 
Verwendet doch einfach die Code-Tags:

<span class="inlineSyntax"><span class="inlineSyntax"><span class="codecomment">{PROTECTTAG379b91d49b2877e2c2d3a42b42a2a17d}</span></span></span>

:arrow: Ergibt:

<span class="inlineSyntax"><span class="codecomment">{PROTECTTAG379b91d49b2877e2c2d3a42b42a2a17d}</span></span>

(Durch Leerzeichen am Ende der Code-Zeile wird das "Quelltext:" übergangen ;))
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Fr 03.10.08 18:23 
Hi,

Manchmal will man das aber nicht, bzw. es geht nicht(z.B. Highlight-Tag).
Mein Entwurf für dazu dafür(:mrgreen:) sieht übrigens im Moment so aus:

Deinen Quelltext packst du am besten in Delphi-Tags:
  <span class="inlineSyntax"><span class="codecomment">{PROTECTTAG4cdca684c1ea1116c6e35ecc714197da}</span></span>

Einzelne Stellen markierst du mit dem
Highlight-Tag:

[highlight] markierte Stelle [/highlight]


E: Autsch :autsch: Toller Fehler(s.o.)

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)