Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi END. fehlt am Modulende (https://www.delphipraxis.net/123048-end-fehlt-am-modulende.html)

torf160 26. Okt 2008 16:02


END. fehlt am Modulende
 
Hallo, ich versuche etwas zu drucken, mit Delphi 3.
Ich bekomme nun immer die Fehlermeldung "END. fehlt am Modulende"

Natürlich ist da ein END. und ich habe auch den Code lokalisieren können,
der den Fehler verursacht, ich kann mir aber nicht erklären, woran es liegt.

Wenn ich die beiden markierten Bedingungen "if LKPunkte....." entferne,
bekomme ich keine Fehlermeldung mehr.

Woran liegt es???

Ich hoffe, hier kann mir jemand helfen.

Schon mal vielen Dank.
torf160



Delphi-Quellcode:
procedure TForm1.drucken1Click(Sender: TObject);
var i    : integer;
    ORand : integer;
    s    : string;
begin
  if PrintDialog1.Execute then
  begin
    Printer.BeginDoc;
    SetMapMode(Printer.Canvas.Handle, MM_LOMETRIC); //Umstellen auf 1/10 mm
    ORand := -400;
    with printer.Canvas do
    begin
      Font.Name:='Arial Narrow';
      Font.Color:= clBlack;          // Schriftfarbe Schwarz
      Brush.Color:=clWhite;          // Hintergrundfarbe Weiß
      Font.Style:=[];                // Schriftstil = ohne
      Font.Height:=40;               // Schrifthöhe = 2 mm

      For i := 1 to Anzahl do
      begin
        if LK[i].vereinbart then
        begin
          TextOut(200, ORand, LK[i].Nr);
          TextOut(300, ORand, Form1.LK[i].Bezeichnung);
          TextOut(940, ORand, 'Mo-Fr');
          if LK[i].Taeglich_MoFr > 0 then
          begin
            s := IntToStr(LK[i].Taeglich_MoFr) + ' x tägl.';
            TextOut(1160 - TextWidth(s), ORand, s);
            s := IntToStr(LK[i].Monatlich_MoFr) + ' x mtl.';
            TextOut(1290 - TextWidth(s), ORand, s);
{-------------------------------------------------------------------------}
            if LKPunkte then
            begin
              s := format('%n', [LK[i].Punkte_MoFr]);
              TextOut (1500 - TextWidth(s), ORand, s);
              s := format('%n', [LK[i].Punkte_Summe_MoFr]);
              TextOut (1700 - TextWidth(s), ORand, s)
            else
            begin
              s := format('%n', [LK[i].Preis_MoFr]);
              TextOut (1500 - TextWidth(s), ORand, s);
              s := format('%n', [LK[i].Preis_Summe_MoFr]);
              TextOut (1700 - TextWidth(s), ORand, s);
            end; // if LKPunkte
{-------------------------------------------------------------------------}
          end; // if LK[i].Taeglich_MoFr

          TextOut(300, ORand - 40, Form1.LK[i].Bemerkung);
          TextOut(940, ORand - 40, 'Sa-So');
          if LK[i].Taeglich_SaSo > 0 then
          begin
            s := IntToStr(LK[i].Taeglich_SaSo) + ' x tägl.';
            TextOut(1160 - TextWidth(s), ORand - 40, s);
            s := IntToStr(LK[i].Monatlich_SaSo) + ' x mtl.';
            TextOut(1290 - TextWidth(s), ORand - 40, s);
{-------------------------------------------------------------------------}
            if LKPunkte then
            begin
              s := format('%n', [LK[i].Punkte_SaSo]);
              TextOut (1500 - TextWidth(s), ORand - 40, s);
              s := format('%n', [LK[i].Punkte_Summe_SaSo]);
              TextOut (1700 - TextWidth(s), ORand - 40, s)
            else
            begin
              s := format('%n', [LK[i].Preis_SaSo]);
              TextOut (1500 - TextWidth(s), ORand - 40, s);
              s := format('%n', [LK[i].Preis_Summe_SaSo]);
              TextOut (1700 - TextWidth(s), ORand - 40, s);
            end; // if LKPunkte
{-------------------------------------------------------------------------}
          end; // if LK[i].Taeglich_SaSo

          ORand := ORand - 100;
        end; // if LK[i].vereinbart
      end; // For i := 1 to Anzahl
    end; // with printer.Canvas do
    Printer.enddoc;
  end; // if PrintDialog1.Execute
end;

Dax 26. Okt 2008 16:05

Re: END. fehlt am Modulende
 
Delphi-Quellcode:
            if LKPunkte then
            begin
              s := format('%n', [LK[i].Punkte_MoFr]);
              TextOut (1500 - TextWidth(s), ORand, s);
              s := format('%n', [LK[i].Punkte_Summe_MoFr]);
              TextOut (1700 - TextWidth(s), ORand, s);
            end // fehlt das nicht? bei einem else ohne if sollte der compiler auch schon ein wenig früher aussteigen als beim "END."...
            else
            begin
              s := format('%n', [LK[i].Preis_MoFr]);
              TextOut (1500 - TextWidth(s), ORand, s);
              s := format('%n', [LK[i].Preis_Summe_MoFr]);
              TextOut (1700 - TextWidth(s), ORand, s);
            end; // if LKPunkte

SirThornberry 26. Okt 2008 16:05

Re: END. fehlt am Modulende
 
so etwas hier gibt es in delphi nicht:
Delphi-Quellcode:
if LKPunkte then
begin
  //
else
begin
  //
end;
zu jedem beginn gehört auch ein end:
Delphi-Quellcode:
if irgendwas then
begin
  //
end
else
begin
  //
end;

mkinzler 26. Okt 2008 16:05

Re: END. fehlt am Modulende
 
Es fehlt ein ein end
Delphi-Quellcode:
              TextOut (1700 - TextWidth(s), ORand, s);
            end
            else

torf160 26. Okt 2008 16:42

Re: END. fehlt am Modulende
 
:-D
Toll, nun funktioniert es!

Vielen Dank, für die schnelle Hilfe.

torf160


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:47 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