Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Software-Projekte der Mitglieder (https://www.delphipraxis.net/26-software-projekte-der-mitglieder/)
-   -   SC-Tool: Zur Quelltextformatierung (https://www.delphipraxis.net/47195-sc-tool-zur-quelltextformatierung.html)

Koma-Code 7. Jun 2005 17:38


SC-Tool: Zur Quelltextformatierung
 
Hi,

ich habe mir ein kleines Tool geschrieben, welches den Quelltext automatisch
formatiert.

Ich habe die Formatierungsart sehr an meinen Stil angepaßt und hoffe dass es
Fehlerfrei funktioniert.

Die Quelltextinformationen (wie oft procedure, function vorkommt, wieviel Zeichen das Projekt hat, ...) sind sehr langsam, bei langen Texten!

Ein Formatierungsbeispiel:


Delphi-Quellcode:
procedure Execute (test: String);
var
e, f : Integer;
TempList : TStringList;

begin
TempList := TStringList.Create;
TempList.Clear;
 
For e := 0 to 10 Do
if e < 0 then TempList.Add ('test');
 
For e := 0 to 10 Do
if e < 0 then
TempList.Add ('test');
 
For e := 0 to 10 Do
begin
 if e < 0 then
begin
TempList.Add ('test');
end
else
begin
TempList.Add ('test');
end;
 
if e <0 then f := 4
else f:=5;
end;
end;
zu

Delphi-Quellcode:
procedure Execute (test: String);
var
 e, f : Integer;
 TempList : TStringList;
 
begin
 TempList := TStringList.Create;
 TempList.Clear;
 
 For e := 0 to 10 Do
  if e < 0 then TempList.Add ('test');
 
 For e := 0 to 10 Do
  if e < 0 then
   TempList.Add ('test');
 
 For e := 0 to 10 Do
  begin
   if e < 0 then
    begin
     TempList.Add ('test');
    end
   else
    begin
     TempList.Add ('test');
    end;
   
   if e <0 then f := 4
    else f:=5;
  end;
end;

Download (ca. 300 kb):
www.koma-code.de/ProgsZip/SC_Tool.zip


Grüße,

KM

[edit=alcaeus]Delphi- statt Code-Tags verwendet. Mfg, alcaeus[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:58 Uhr.

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-2025 by Thomas Breitkreuz