Autor Beitrag
Blamaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164



BeitragVerfasst: Fr 06.06.08 20:07 
Hi,

gibt es ein Plugin oder Zusatz für Delphi welches den Code automatisch passend einrückt ?

Ich kann es mir irgendwie nicht angewöhnen das automatisch selbst zu machen, aber gerade bei viel code wird es doch etwas unübersuchtlich.

mfg Blamaster


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am Fr 06.06.2008 um 20:10
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: Fr 06.06.08 21:58 
user profile iconBlamaster hat folgendes geschrieben:
Hi,

gibt es ein Plugin oder Zusatz für Delphi welches den Code automatisch passend einrückt ?

Ich kann es mir irgendwie nicht angewöhnen das automatisch selbst zu machen, aber gerade bei viel code wird es doch etwas unübersuchtlich.


such' mal auf Google nach "delphi code formatter".

z.B. www.dummzeuch.de/del...experts/english.html

(Da ich der Maintainer dieser speziellen GExperts Version bin, bin ich natuerlich etwas parteiisch.)

twm
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Fr 06.06.08 22:05 
hi,

ich hatte bei meinem Delphi 7 das "DelForEx" kann ich nur empfehlen...

bei meiner Turbo Version geht das nun allerdings nicht mehr... :-( kann man da irgentwas machen oder gibt des da alternativen? Ich weis das der GExperts Plugin sich leider auch nicht integrieren lässt

gut noch n schönen abend
Tschau
Dunkel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 682

Mac OS X Snow Leopard
Xcode 3.1
BeitragVerfasst: Fr 06.06.08 23:11 
user profile iconStefan-W hat folgendes geschrieben:
Ich weis das der GExperts Plugin sich leider auch nicht integrieren lässt

Wer hat Dir das geflüstert? Natürlich geht das, selbst in der beschnittenen Explorer-Version von Turbo Delphi!

_________________
Ich streite einsam mich mit dieser Oberflächenwelt
Gutes sei ein löblich Brot von dem ich zehre - bis zum Tod [Das Ich - Im Ich]
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: Sa 07.06.08 11:27 
user profile iconDunkel hat folgendes geschrieben:
user profile iconStefan-W hat folgendes geschrieben:
Ich weis das der GExperts Plugin sich leider auch nicht integrieren lässt

Wer hat Dir das geflüstert? Natürlich geht das, selbst in der beschnittenen Explorer-Version von Turbo Delphi!


Kommt drauf an, welche Explorer-Version Du hast. Die urspruenglichen Downloads hatten noch ein paar Luecken, mittels derer man sogar eigene Komponenten installieren konnte. Mit den aktuellen Downloads oder auch, wenn man die Updates einspielt, ist das nicht mehr moeglich. (Es sei denn, man patcht sie, aber das verstoesst gegen die Lizenz.)

DelForEx funktioniert meines Wissens auch noch mit den aktuellen Delphi-Versionen (ausser Explorer), zur Not compiliert man sich das Plugin aus den Sourcen selbst. Aber da in GExpert die gleiche Formatter-Engine + Bugfixes + ein paar Erweiterungen benutzt, sehe ich keinen Grund mehr dafuer, DelForEx zu verwenden.

Es gab auf irgendeiner chinesischen Download-Seite mal ein Plugin, das zumindest von den Screenshots nach DelForEx aussah, keine Ahnung, ob das ein Clone war oder ob sie die Sourcen hatten. Ich weiss auch nicht mehr, wo das war.

twm
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Sa 07.06.08 12:36 
@dummzeuch: gut zu wissen... vllt sollt ich mich doch noch mal genauer damit befassen
Blamaster Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164



BeitragVerfasst: Sa 07.06.08 14:46 
Vielen dank :)
snyder
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Fr 21.05.10 08:03 
Auch wenn nicht mehr ganz aktuell:

wie siehts mit entsprechenden Addons für Delphi 5 aus?
Bin Arbeitsplatztechnisch leider an diese Version gebunden.
lblbw
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 122

Win XP, Win 7
Delphi7 Enterprise
BeitragVerfasst: Fr 21.05.10 08:10 
Nimm doch einfach das, was hier angeboten wurde: DelForEx
SmileySN
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 297

WinXP, Win7
Delphi 2010 Professional
BeitragVerfasst: Fr 21.05.10 09:04 
Wenn man es noch schöner haben möchte mit Darstellung der zusammengehörenden Programm-Blöcke und mit vielen Tools, dann empfehle ich die cnWizards, die Formatierung damit ist einfach genial.
Und es sind viele Hilfen drin, die es sonst nur ab D2010 gibt.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 21.05.10 09:11 
DelForEx gibt es auch als eigenständiges Programm. Heißt dann nur DelFor. Ist natürlich nicht so bequem.
snyder
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Fr 21.05.10 14:54 
DelForEx funktioniert super.
War mir nicht direkt klar, dass es auch für Delphi 5 geht, aber
läuft von D2 bis D2007

danke =)
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 21.05.10 18:32 
user profile iconStefan-W hat folgendes geschrieben Zum zitierten Posting springen:
hi,

ich hatte bei meinem Delphi 7 das "DelForEx" kann ich nur empfehlen...

bei meiner Turbo Version geht das nun allerdings nicht mehr... :-( kann man da irgentwas machen oder gibt des da alternativen? Ich weis das der GExperts Plugin sich leider auch nicht integrieren lässt

gut noch n schönen abend
Tschau


Kann nicht sein, ich habe GExperts in D5 und Turbo Delphi integriert.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Fr 21.05.10 18:37 
Delphi 2010 hat einen Formatter sogar schon eingebaut: Strg+D.

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: Sa 22.05.10 21:21 
user profile iconHidden hat folgendes geschrieben Zum zitierten Posting springen:
Delphi 2010 hat einen Formatter sogar schon eingebaut: Strg+D.


Ist der inzwischen eigentlich benutzbar? Als ich ihn zuletzt ausprobiert habe, habe ich mich mit Grausen abgewendet.

twm
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Sa 22.05.10 22:52 
Also meinen Code lässt er so wie er ist, abgesehen von Kommentaren. Mal gerade mit müllformatiertem Code ausprobieren.

E: Also bei meinen Tests jetzt gerade war's okay. Hast du mal ein Beispiel, das du bisher nicht so toll eingerückt/verschandelt fandest?

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: So 23.05.10 17:52 
user profile iconHidden hat folgendes geschrieben Zum zitierten Posting springen:

E: Also bei meinen Tests jetzt gerade war's okay. Hast du mal ein Beispiel, das du bisher nicht so toll eingerückt/verschandelt fandest?


Es schein tatsaechlich nicht mehr so schlimm zu sein, wie ich es in Erinnerung hatte (Vielleicht war das auch noch Delphi 2009?). Was mir gerade beim Test auffiel ist dieses. Aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
    {: Creates a TIniVersionInfo instance.
       @param FullFilename is the full filename including path and extension of
                           file to use
       @param InfoSection is the name of the section that contains the general
                          version info like Major/Minor version, Release etc.
                          In a Delphi .dof file this section is called [Version Info]
       @param InfoKeySection is the name of the section that contains the additional
                             strings of the version information
                             In a Delphi .dof file this section is called [Version Info Keys] }

    constructor Create(const _FullFilename: stringconst _InfoSection: string;
      const _InfoKeysSection: string);


wird:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
    { : Creates a TIniVersionInfo instance.
      @param FullFilename is the full filename including path and extension of
      file to use
      @param InfoSection is the name of the section that contains the general
      version info like Major/Minor version, Release etc.
      In a Delphi .dof file this section is called [Version Info]
      @param InfoKeySection is the name of the section that contains the additional
      strings of the version information
      In a Delphi .dof file this section is called [Version Info Keys] }

    constructor Create(const _FullFilename: stringconst _InfoSection: string;
      const _InfoKeysSection: string);


Ich bin der festen Ueberzeugung, dass der Formatter seine Finger von der Formatierung von Komentaren lassen sollte.

Und dann waere da noch das:

ausblenden Delphi-Quelltext
1:
2:
3:
    property InternalName: string read GetInternalName write SetInternalName;
    property LegalCopyright: string read GetLegalCopyright write SetLegalCopyright;
    property LegalTrademarks: string read GetLegalTrademarks write SetLegalTrademarks;


was er zu

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
    property InternalName: string read GetInternalName write SetInternalName;
    property LegalCopyright
      : string read GetLegalCopyright write SetLegalCopyright;
    property LegalTrademarks: string read GetLegalTrademarks write
      SetLegalTrademarks;


macht. Ich kann verstehen, dass er versucht, die Zeilenlaenge zu begrenzen, aber wie sinnvoll ist der Umbruch der LegalCopyright Zeile?

Ich vermute, wenn ich weitersuchte, wuerde ich noch mehr finden. Ich erinnere mich z.B. dass anonyme Methoden sehr seltsam formatiert wurden, und hatte dazu auch einen QC-Report geschrieben, aber den kann ich gerade nicht nachlesen, da qc.embarcadero.com mal wieder ein Problem mit seinen Datenbankzugriffen hat.

twm
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 23.05.10 19:00 
Naja, Zeilenlänge halt. Besser wäre es an dieser Stelle aber glaube, wenn er nicht vor read\write oder in Mitten einer Typ-Angabe umbrechen würde. Im Zweifel ist man mit Hand von daher eh immer besser ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 23.05.10 20:18 
Ein einzelnes Strg+z macht die Aktion ja glücklicherweise rückgängig. Nützt aber auch nichts, wenn man größere Mengen Code hat. :nixweiss:

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)