Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   Formatierungsproblem (https://www.delphipraxis.net/215313-formatierungsproblem.html)

DerMondistunsereSonne 12. Jun 2024 08:52

Formatierungsproblem
 
Moin,

Die Standardformatierung erzeugt mir leider so etwas

Delphi-Quellcode:
myFoobar:
array of record foo: string;
bar:
integer;
Aussehen soll es allerdings so:

Delphi-Quellcode:
myFooBar: array of record:
   foo: string;
   bar: integer
Kann mir jemand sagen, welche Formatierungsoptionen da helfen könnten?

uligerhardt 12. Jun 2024 09:03

AW: Formatierungsproblem
 
Zitat:

Zitat von DerMondistunsereSonne (Beitrag 1537649)
Moin,

Die Standardformatierung erzeugt mir leider so etwas

Delphi-Quellcode:
myFoobar:
array of record foo: string;
bar:
integer;
Aussehen soll es allerdings so:

Delphi-Quellcode:
myFooBar: array of record:
   foo: string;
   bar: integer
Kann mir jemand sagen, welche Formatierungsoptionen da helfen könnten?

Ich nutze den eingebauten Formatierer nicht, aber ich könnte mir vorstellen, dass es hilft, den Record-Typ explizit zu benamsen.

DerMondistunsereSonne 12. Jun 2024 11:24

AW: Formatierungsproblem
 
Moin,

Nein habe ich nicht, da bin ich dann auch 1/2 Tag mit beschäftigt, dank meinem Vorgänger.

uligerhardt 12. Jun 2024 12:35

AW: Formatierungsproblem
 
Hmmm, hab's mal ausprobiert:
Delphi-Quellcode:
type
  TmyFooBar = record
    foo: string;
    bar: integer;
  end;

  TmyFooBars = array of TmyFooBar;

var
  myFooBars2: array of TmyFooBar;
  myFooBars3: TmyFooBars;
  myFooBars1: array of record foo: string;
  bar: integer;
end;
myFooBars4:
TmyFooBars;
Das "array of record"-Konstrukt stört den Formatierer gewaltig. Danach kann er auch Sachen nicht mehr, die vorher gingen (z.B. myFooBars3 vs. myFooBars4).

DerMondistunsereSonne 12. Jun 2024 13:07

AW: Formatierungsproblem
 
Dann bedanke ich bei meinem Vorgänger und kauf schon mal nen Spaten. :twisted:

himitsu 12. Jun 2024 14:09

AW: Formatierungsproblem
 
Dieser Formatierer mag kennt halt keine Variablen mit Typdefinition.

Auch keine Inlinevariablen, sowie Inlinekonstanten und
Delphi-Quellcode:
for var i :=
sowieso nicht.

uligerhardt 12. Jun 2024 14:11

AW: Formatierungsproblem
 
Zitat:

Zitat von DerMondistunsereSonne (Beitrag 1537665)
Dann bedanke ich bei meinem Vorgänger und kauf schon mal nen Spaten. :twisted:

Mein Beileid ;-)
Aber der Fehler liegt ja im Formatierer. Dein Vorgänger kann nix dafür, dass bei Borland/Embarcadero/... mit halbem Arsch gearbeitet wird.
Genau wegen solcher Situationen habe ich gelernt, lieber explizit zu sein, auch wenn es theoretisch unnötig ist.

uligerhardt 12. Jun 2024 14:14

AW: Formatierungsproblem
 
Zitat:

Zitat von himitsu (Beitrag 1537673)
Dieser Formatierer mag kennt halt keine Variablen mit Typdefinition.

Auch keine Inlinevariablen, sowie Inlinekonstanten und
Delphi-Quellcode:
for var i :=
sowieso nicht.

Ich bleibe beim GExperts-Formatierer.

DerMondistunsereSonne 12. Jun 2024 14:15

AW: Formatierungsproblem
 
Ja vieles fühlt sich für mich an, als ob es gute Ansätze gab, die dann nicht mehr weiterverfolgt wurden.

Und mein Vorgänger hat ein paar sehr lustige Dinge eingebaut...falls ich mal ein Buch über das Rework schreibe, habe ich schon genug um die langweiligen Passagen zu füllen ;)

Uwe Raabe 12. Jun 2024 14:52

AW: Formatierungsproblem
 
Zitat:

Zitat von uligerhardt (Beitrag 1537676)
Ich bleibe beim GExperts-Formatierer.

Da der Delphi-Formatter zu dem Modeling-Paket gehört, das in D12 schon optional ist und in zukünftigen Versionen vermutlich ganz verschwinden wird (zumindest in der aktuellen Implementierung), scheint mir das eine durchaus vernünftige Entscheidung zu sein.


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:04 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz