Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi PrintText Problem (https://www.delphipraxis.net/102029-printtext-problem.html)

Tommy1988 22. Okt 2007 14:25


PrintText Problem
 
Folgender Code hat bis eben ohne zu meckern funktioniert, aufeinmal nicht mehr:

Delphi-Quellcode:
var Line: Integer;
  PrintText: TextFile;
begin
  if PrintDialog1.Execute then begin
    AssignPrn(PrintText);
    Rewrite(PrintText);
    try
      Printer.Canvas.Font := Memo1.Font;
      for Line := 0 to SynMemo1.Lines.Count - 1 do
        Writeln(PrintText, Memo1.Lines[Line]);
    finally
      CloseFile(PrintText); // Fehler: Angeblich zuviele Parameter!
    end;
  end;
end;
Fehler ist markiert.

Muetze1 22. Okt 2007 14:36

Re: PrintText Problem
 
Schreib mal den Unitnamen (SysUtils.) vor den Funktion.

Sorry, mein Fehler. Die Funktion Delphi-Referenz durchsuchenCloseFile() liegt in der Unit System und von daher wäre dort kein Prefix notwendig.

Mal was anderes: Du musst eine Funktion/Methode haben, welche genau so heisst. Von daher: Rechtsklick auf CloseFile() und dann "Deklaration suchen" um dann zu ermitteln, was der Compiler denn findet...


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