AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi [Erledigt]Totales Brett vorm Kopf: Problem mit 'end'
Thema durchsuchen
Ansicht
Themen-Optionen

[Erledigt]Totales Brett vorm Kopf: Problem mit 'end'

Ein Thema von inherited · begonnen am 12. Feb 2006 · letzter Beitrag vom 13. Feb 2006
Antwort Antwort
Seite 1 von 3  1 23      
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#1

[Erledigt]Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 18:52
Hi
Entweder habe ich ein KOMPLETTES Brett vorm Kopf gerade, oder sonste was. Er sagt es fehle ein 'end', aber wo?
Bitte Schnelle Hilfe!

Delphi-Quellcode:
    if (Command[1]+Command[2]+Command[3]+Command[4]+Command[5]) = 'LOGINthen
    begin
      OK:=true;
      for i := 0 to ListBox1.Count-1 do if Uppercase(ListBox1.Items[i])=Copy(Command, 6, Length(Command)) then OK:=false;

      if ok then
      begin
        if (Copy(Command, 6, Length(Command)) = 'HAMSTER') or (Copy(Command, 6, Length(Command)) = 'IGEL') then
        begin
          ListBox1.Items.Add(Copy(Command, 6, Length(Command)));
          AThread.Connection.WriteLn('VER:0.1');
          lbProcesses.Items.Insert(0, 'Sending Command: loginok');
        end;
      end;
    end
    else
    begin
      AThread.Connection.WriteLn('loginnotok');
    end;
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 18:55
Es fehlt nicht in diesem Code-Stück, aber wohl woanders Wahrscheinlich davor.

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#3

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 18:57
Erstmal danke für die mühe, hier ist die komplette procedure, ääääh Pro>z<edur
Delphi-Quellcode:
procedure TfrmMain.IdTCPServerExecute(AThread: TIdPeerThread);
var
    Command, Answer : String; i, j : Integer; OK: Boolean;
begin
  if Edit1.Text<>'then
  begin
    AThread.Connection.WriteLn(Edit1.Text);
    Exit;
  end;
Answer:='';
Command := AThread.Connection.ReadLn;
lbProcesses.Items.Insert(0, 'Getting Command: '+Command);

Command := uppercase(Command);


if Command = 'TIMEthen begin
    AThread.Connection.WriteLn(FormatDateTime('hh:nn:ss',now));
    lbProcesses.Items.Insert(0, 'Sending Command: '+FormatDateTime('hh:nn:ss',now)); end
else if Command = 'DATEthen begin
    AThread.Connection.WriteLn(FormatDateTime('dd/mmm/yyyy',date));
    lbProcesses.Items.Insert(0, 'Sending Command: '+FormatDateTime('dd/mmm/yyyy',date)); end
else if Command = 'TICKCOUNTthen begin
    j:=GetTickCount;
    AThread.Connection.WriteLn(IntToStr(j));
    lbProcesses.Items.Insert(0, 'Sending Command: '+IntToStr(GetTickCount)); end
else if Command = 'QUITthen
    begin
    AThread.Connection.WriteLn('Cya!');
    lbProcesses.Items.Insert(0, 'Sending Command: Cya!');
    AThread.Connection.Disconnect;
    end

else if Command = 'GETLISTthen
    begin
    for i := 0 to ListBox1.Count-1 do Answer:=Answer+('; '+ListBox1.Items[i]);
    AThread.Connection.WriteLn(Answer);
    lbProcesses.Items.Insert(0, 'Sending Command: '+Answer)
    end

else if Command = 'SHUTDOWNthen
    begin
    AThread.Connection.WriteLn('Shutdown Server');
    lbProcesses.Items.Insert(0, 'Shutdown Server');
    AThread.Connection.Disconnect;
    btnExit.Click;
    end

else if Command = 'RESTARTthen
    begin
    AThread.Connection.WriteLn('Restarting Server in 3 seconds...');
    lbProcesses.Items.Insert(0, 'Restarting Server in 3 seconds...');
    Timer1.Enabled:=true;

    end

else if (Command[1]+Command[2]+Command[3]+Command[4]+Command[5]) = 'LOGINthen
    begin
      OK:=true;
      for i := 0 to ListBox1.Count-1 do if Uppercase(ListBox1.Items[i])=Copy(Command, 6, Length(Command)) then OK:=false;

      if ok then
      begin
        if (Copy(Command, 6, Length(Command)) = 'HAMSTER') or (Copy(Command, 6, Length(Command)) = 'IGEL') then
        begin
          ListBox1.Items.Add(Copy(Command, 6, Length(Command)));
          AThread.Connection.WriteLn('VER:0.1');
          lbProcesses.Items.Insert(0, 'Sending Command: loginok');
        end;
      end;
    end
    else
      begin
      AThread.Connection.WriteLn('loginnotok');
      end

    else if Command[1]+Command[2]+Command[3]+Command[4]+Command[5]+Command[6] = 'LOGOUTthen
    begin
      for i := 0 to ListBox1.Count-1 do
      begin
        if Uppercase(ListBox1.Items[i])=Copy(Command, 7, Length(Command)) then
        begin
          ListBox1.Items.Delete(i);
          lbProcesses.Items.Insert(0, ('Logged out '+Copy(Command, 7, Length(Command))));
        end;
      end;
      AThread.Connection.WriteLn('logoutok');
    end

else
begin
AThread.Connection.WriteLn('Ungültiger Befehl!');
lbProcesses.Items.Insert(0, 'Sending Command: Ungültiger Befehl!');
end;

end;
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
mindforce
(Gast)

n/a Beiträge
 
#4

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 18:58
Ne Brett vorm Kopf hast du nicht.


ACHTUNG: Nimm die end´s weg die vor dem Quellcode ende kommt!
MERKEN: Ein end kommt ans end(e)!!!!!!!!!!!!!!!



Es gibt nämlich 3 Arten von end

- end

- end;

- end.

Ich hatte auch Probleme mit diesem end.

Probier mal end; und end.

Dann dürfte es klappen. Wie gesagt: Ich hatte auch dauernd dieses Problem

Gruss,

Mindforce
  Mit Zitat antworten Zitat
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#5

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:01
Ds ist auch nicht der komplette Quellcode, sondern nur eine Procedur daraus. Das ende des Programms ist das nicht
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#6

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:03
@MindForce: Was hilft es Ends wegzunehmen, wenn welche fehlen?

@inherited: auf den ersten Blick schaut der Code auch okay aus. Die Anzahl der Begin und der End ist identisch, wie es innerhalb einer Prozedur sein sollte. Allerdings ist die Formattierung (sorry) imo grauenhaft, so dass ich es nicht nachvollziehen kann, ob die Matches zwischen den begin-end Parts stimmen.

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Alt 12. Feb 2006, 19:05     Erstellt von mindforce
Dieser Beitrag wurde von sakura gelöscht. - Grund: Unproduktiv
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#7

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:07
^^
ja ich weiss, aber das sollte den compiler ja nicht au der fassung bringen.
So langsam fange ih an, an meinem Verstand zu zweifeln.
HIIILLLLFFEEEEEEEEE. Kann mir denn keiner Helfen?
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
Alt 12. Feb 2006, 19:09     Erstellt von inherited
Dieser Beitrag wurde von sakura gelöscht. - Grund: Unproduktiv
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#8

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:13
omg chon der 3.^^
Wenn ich den teil mit dem LOGIN auskommentiere dann GEHTS
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
mindforce
(Gast)

n/a Beiträge
 
#9

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:14
Kannst du auch Sätze schreiben, die man auch verstehen kann?

Sry
  Mit Zitat antworten Zitat
Martin.Ghosts

Registriert seit: 9. Dez 2005
54 Beiträge
 
Delphi 7 Personal
 
#10

Re: Totales Brett vorm Kopf: Problem mit 'end'

  Alt 12. Feb 2006, 19:16
Mh, also ich hab auch mal nachgezählt und finde genau so viele ends wie begins.
Ich bin zwar noch nicht so lange dabei, aber vielleicht hilft es ja was wenn man ein bisschen Übersicht in den Quelltext reinbringt. Also ich musste mir doch einige Stellen bisschen länger anschauen um dahinterzusteigen.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 3  1 23      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:43 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz