Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   Falsche Zeichen in Projektdatei (https://www.delphipraxis.net/197874-falsche-zeichen-projektdatei.html)

Hobbycoder 13. Sep 2018 12:36

Falsche Zeichen in Projektdatei
 
Hi,

ich habe mir gerade mal eine Komponente https://github.com/SynEdit/SynEdit aus dem Internet geladen. Beim Compilieren meldet er einen Fehler:
Delphi-Quellcode:
package SynEdit_D;

{$R *.res}
{$R '..\..\Source\SynEditReg.dcr'}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST ON}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'SynEdit component suite'}
{$LIBSUFFIX '101B'}
{$DESIGNONLY}
{$IMPLICITBUILD ON}

rrequires
  designide,
  SynEdit_R;

ocontains
  SynEditReg in '..\..\Source\SynEditReg.pas',
  SynEditPropertyReg in '..\..\Source\SynEditPropertyReg.pas',
  SynHighlighterManager in '..\..\Source\SynHighlighterManager.pas';

d.
Man beachte die Zeile 'requires', 'contains' und 'end.'
In der Datei auf der Platte ist's aber korrekt. Woher kommt das? Ich habe das ab und an mal wenn ich mir eine Komponente installiere. War aber nur in der DPR vom Runtime-Package.
(10.1 Berlin)

GPRSNerd 13. Sep 2018 14:14

AW: Falsche Zeichen in Projektdatei
 
Ist ein Fehler, den ich seit gefühlten 10 Delphi-IDE-Versionen mal mehr oder mal weniger habe.
Tritt bei mir häufiger auf, wenn ich ein großes Package mit etlichen Komponenten-Projekten builde.
Ich habe leider nie herausfinden können, wann oder wodurch es auftritt...

Hier ist was dazu in den Emba-Foren:
https://forums.embarcadero.com/threa...hreadID=266432

Aha:

Zitat:

As Olivier said, this is caused by a mix of CR and CRLF line terminators in the file.

To fix it, here is what I did.

1. I opened the file in 32-bit non-Unicode notepad (this was a bit ago). The CR breaks did not resolve, and the lines were merged together.
2. Hit enter where the line break should be. That put the CRLF in the correct place.
3. Saved

It is very beneficial if you can see this in a separate text editor that shows different characters between CR and CRLF; maybe Notepad++?. In my case, I didn't have one, but the file compare in TortoiseGit would show the CR as a straight-down arrow and the CRLF as a bent arrow.

KodeZwerg 13. Sep 2018 14:33

AW: Falsche Zeichen in Projektdatei
 
Das obige Zitat funktioniert heute immer noch so. Wie andere Text Editoren das handhaben kann ich nicht beurteilen aber Datei mit Notepad++ reinladen, ohne Kodierung speichern, problem erledigt.

Delphi.Narium 13. Sep 2018 14:52

AW: Falsche Zeichen in Projektdatei
 
Wenn man's selbst reparieren will:
Delphi-Quellcode:
procedure CRLFReparatur(AFilename : String);
var
  sl : TStringList;
begin
  sl := TStringList.Create;
  sl.LoadFromFile(AFilename);
  sl.SaveToFile(AFilename);
  sl.Free;
end;

begin
  // Hier kann man natürlich auch über 'nen Filedialog oder sonstwie
  // die Datei(en) auswählen.
  CRLFReparatur('c:\temp\synedit_d.dpk');
end;

Sherlock 13. Sep 2018 15:42

AW: Falsche Zeichen in Projektdatei
 
Einmal die Codeformatierung drüber laufen lassen?

Sherlock

Hobbycoder 13. Sep 2018 16:13

AW: Falsche Zeichen in Projektdatei
 
Okay. Ich wollte ja hauptsächlich wissen, ob nur ich das Problem habe, oder ob das bei anderen auch auftritt.

Danke.


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