add comments to blocks
Brought to you by:
anthonysteele
Years ago I found a formatting tool for normal borland pascal that did something I really got used to.
It adds comments to block structures as shown in the example :
PROCEDURE Tmyclass.myproc(Sender: TObject);
BEGIN { PROCEDURE Tmyclass.myproc }
CASE marker OF
$25 :
BEGIN
code here
END;{ CASE marker OF $25: }
$45 :
BEGIN
code here
END;{ CASE marker OF $45: }
$85 :
BEGIN
code here
END;{ CASE marker OF $85: }
END;{ CASE marker }
END;{ PROCEDURE Tmyclass.myproc }
This goes for any block as if / then / else etc.
The comments are set in {}, these comments are deleted when the source code is prepared for converting.
Logged In: YES
user_id=1994679
Originator: YES
Sorry, the formatting is not shown correctly.
Werner
Logged In: NO
Yes! I'm voting for this feature.! There is example of our code. It would be great if this will be automatic.
Possible block comments (behing "end") are:
{if ... begin}
{for ... begin}
{while ... begin}
{case}
{else ... begin}
{try ... finally}
{try ... except}
function TRswSQLDatabase.TableExists(const TableName: WideString): Boolean;
var
TempTableNames: TStringList;
begin
Result := True;
try
ConnectToDatabase;
TempTableNames := TStringList.Create;
try
FConnection.GetTableNames(TempTableNames, False);
if TempTableNames.IndexOf(TableName) < 0 then
Result := False;
finally
TempTableNames.Free;
end;{try ... finally}
except
Result := False;
end;{try ... except}
end;{TableExists}