Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Comments on collapseable function and procedures

1 view
Skip to first unread message

Michael Fritz

unread,
Aug 6, 2008, 5:52:02 AM8/6/08
to
Hi,

Using the {$REGION} directive I can add a comment which gets displayed when
I collapse the appropriate line(s), e.g.:
{$REGION 'Add column header for available columns grid'}
[..]
{$ENDREGION}

Can I do sthg similar with functions and procedures in Turbo Delphi Pro? I
can collapse those lines (and others too) but I would like to see a comment
behind the function name.

I successfully did this using a line like:
procedure DBClearDefaultLayout {Clear default layout in DB};
begin
[..]
end;

Collapsing the first line shows me the comment but Is there another way to
do this?
--
cu,
Michael

Rob Kennedy

unread,
Aug 6, 2008, 9:34:24 AM8/6/08
to
Michael Fritz wrote:
> Using the {$REGION} directive I can add a comment which gets displayed when
> I collapse the appropriate line(s), e.g.:
> {$REGION 'Add column header for available columns grid'}
> [..]
> {$ENDREGION}

That really looks more like the comment for code that should be in a
function of its own. Use regions for groups of functions, not for
sections of single functions.

> Can I do sthg similar with functions and procedures in Turbo Delphi Pro? I
> can collapse those lines (and others too) but I would like to see a comment
> behind the function name.
>
> I successfully did this using a line like:
> procedure DBClearDefaultLayout {Clear default layout in DB};

That's a pointless comment. All it does is echo the function name. I'm
not sure what the function does, though. Is there a layout of something
stored in the database, and this function removes it (deletes rows)? Or
does this function clear the layout of the database itself (drops whole
tables)?

> begin
> [..]
> end;
>
> Collapsing the first line shows me the comment but Is there another way to
> do this?

Put a comment above the function name, where nearly all function-level
documentation goes.

--
Rob

Michael Fritz

unread,
Aug 6, 2008, 11:10:48 AM8/6/08
to
"Rob Kennedy" wrote in message <news:4899a85e$1...@newsgroups.borland.com>:

> Put a comment above the function name, where nearly all function-level
> documentation goes.

Rob, thanks for your comments


--
cu,
Michael

0 new messages