Autor Beitrag
florida
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137

Windows 7 Home Premium, Windows XP Professional, Windows 2000
Delphi 2010 Architect
BeitragVerfasst: Mo 28.06.10 11:59 
Mein letztes Problem mit dem Parser ist nun (fast) beendet. :D
Anstatt, dass der Parser sich immer von 0 auf 1 setzt, zählt er jetzt die Zeilen.
Und siehe da: Es funktioniert. :D

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:
 ParserLbl.Caption := '-1';
 for I := 0 to Editor.Lines.Count - 1 do
 begin
  if ParserLbl.Caption = '-1' then
  begin
   if Editor.Lines[I] = 'text' then
   begin
    ParserLbl.Caption := '0';
    Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
   end;
  end;
  if ParserLbl.Caption = '0' then
  begin
   if Editor.Lines[I] = 'caption' then
   begin
    ParserLbl.Caption := '1';
    Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
   end;
  end;
  if parserlbl.Caption = '1' then
  begin
   ausgabememo.Text := editor.Lines[editor.Lines.Count-1];
  end;
 end;


---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Das einzigste Problem:
Deshalb auf (fast) :wink:
Jetzt habe ich den Quelltext umgeändert, aber die nächsten Zeilen im Editor werden nicht mehr gelesen, wobei ich die Routine solange wiederhole, bis alle Zeilen vom Memo ausgelsen worden sind. Trotzdem geht es nicht. :evil:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  if parserlbl.Caption = '1' then
  begin
   ausgabememo.Text := editor.Lines[editor.Lines.Count-1];
   ParserLbl.Caption := '2';
   Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
  end;
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Mo 28.06.10 12:20 
oh man...warum hörst du nie drauf was andre sagen?
Dann erstellst du haufenweise topics wo im eröffnungspost nichtmal ne Frage steht.
Deine Fehlerbeschreibung wird auch nicht besser. Was z.b. ist hier die Eingabe?

Und nachdenken tust tu anscheinend auch nicht...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  begin
   if Editor.Lines[I] = 'caption' then
   begin
    ParserLbl.Caption := '1';
    Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
   end;
  end;
  if parserlbl.Caption = '1' then
  begin
   ausgabememo.Text := editor.Lines[editor.Lines.Count-1];
  end;


-->das memo wird auf "caption" gesetzt (alles gelöscht)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  if parserlbl.Caption = '1' then
  begin
   ausgabememo.Text := editor.Lines[editor.Lines.Count-1];
   ParserLbl.Caption := '2';
   Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
  end;

Das memo wird immer noch auf "caption" gesetzt, da du alles danach ignorierst. hättest du dein :='2' nicht, dann würde es auf die letzte zeile deiner eingabe gesetzt
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: Mo 28.06.10 14:34 
lol 3 mal das gleiche :!:
zum 1.
zum 2.
zum 3. mal

Langsam solltest Du, user profile iconflorida, dich an die Forenregeln halten!!!!

Gruss Alf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 29.06.10 07:58 
Wozu fragst du überhaupt, wenn du es dann doch besser weißt und die Hinweise einfach ignorierst? :roll:

Und die Logik ist wirklich ein Problem, kann das sein?
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:
 ParserLbl.Caption := '-1';
 for I := 0 to Editor.Lines.Count - 1 do
 begin
  if ParserLbl.Caption = '-1' then
  begin
   if Editor.Lines[I] = 'text' then
   begin
    ParserLbl.Caption := '0';
    Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
   end;
  end;
  if ParserLbl.Caption = '0' then
    // Wann ist das der Fall?
    // Richtig, wenn Editor.Lines[I] = 'text'
  begin
   if Editor.Lines[I] = 'caption' then
     // Du kommst hier NUR an, wenn Editor.Lines[I] = 'text', wie soll es jetzt
     // plötzlich 'caption' sein?!?
   begin
    ParserLbl.Caption := '1';
    Editor.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
   end;
  end;
  if parserlbl.Caption = '1' then
  begin
   ausgabememo.Text := editor.Lines[editor.Lines.Count-1];
  end;
 end;
Du postest nur stupide immer fast den gleichen Quelltext, wunderst dich, dass du mit deiner komischen Herangehensweise nicht weiter kommst und ignorierst alle entsprechenden Hinweise. Gleichzeitig sagst du nicht was du mit dem Quelltext erreichen willst, sondern postest nur den Quelltext, der so aber keinen Sinn macht...

Insofern sehe ich hier in der Diskussion auch keinen Sinn mehr.