Einzelnen Beitrag anzeigen

Benutzerbild von Matze
Matze
(Co-Admin)

Registriert seit: 7. Jul 2003
Ort: Schwabenländle
14.929 Beiträge
 
Turbo Delphi für Win32
 
#1

Mehrfarbige Kommentare in Delphi?

  Alt 15. Aug 2005, 10:25
Hallo zusammen!

Ja das klingt erstmal sehr unsinnig, doch ich hätte gerne mehrfarbige Kommentare in Delphi, um genau zu sein, zweifarbige. Innerhalb von Prozeduren und Fuktionen etc. sollen Kommentare eine andere Farbe haben, als außer halb. Gibt es sowas irgendwie?

Grund ist der, dass der Code so (für mich) deutlich übersichtlicher wird, gerade, wenn er etwas länger ist. Im Folgenden ein kleines Beispiel, wobei man es da evtl. nicht versteht, wieso es übersichtlicher sein soll:

Aktuell:
Code:
[color=#008000]//==============================================================================
// Constructor to create TabSheets
//==============================================================================[/color]
[b]constructor[/b] TTabDoc.Create(AOwner:TComponent; DocType: integer; title: [b]string[/b]; FileName: string);
[b]var[/b]
  TBItem: TTBCustomItem;
[b]begin[/b]
  [color=#008000]//Show filename in caption[/color]
  Form1.Caption := ProgName + ' - ' + title;

  [b]inherited[/b] Create;

  [color=#008000]//Create Tabs to switch between documents[/color]
  DocTab := TTabSheet.Create(Application.MainForm); [color=#008000]//Maybe here a comment[/color]
  DocTab.PageControl := Form1.PageControl5;
  DocTab.Caption := title;

  [color=#008000]//Another comment[/color]
übersichtlicher finde ich folgendes, da die Funktionen einfach hervorgehoben werden:

Code:
[color=#008000]//==============================================================================
// Constructor to create TabSheets
//==============================================================================[/color]
[b]constructor[/b] TTabDoc.Create(AOwner:TComponent; DocType: integer; title: [b]string[/b]; FileName: string);
[b]var[/b]
  TBItem: TTBCustomItem;
[b]begin[/b]
  [color=#FFC600]//Show filename in caption[/color]
  Form1.Caption := ProgName + ' - ' + title;

  [b]inherited[/b] Create;

  [color=#FFC600]//Create Tabs to switch between documents[/color]
  DocTab := TTabSheet.Create(Application.MainForm); [color=#FFC600]//Maybe here a comment[/color]
  DocTab.PageControl := Form1.PageControl5;
  DocTab.Caption := title;

  [color=#FFC600]//Another comment[/color]
Gibt es sowas?
  Mit Zitat antworten Zitat