Comments on collapseable function and procedures

This is a discussion on Comments on collapseable function and procedures within the Delphi forums in Programming Languages category; 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...

Go Back   Application Development Forum > Programming Languages > Delphi

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-06-2008, 05:52 AM
Michael Fritz
Guest
 
Default Comments on collapseable function and procedures

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
Reply With Quote
  #2  
Old 08-06-2008, 09:34 AM
Rob Kennedy
Guest
 
Default Re: Comments on collapseable function and procedures

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
Reply With Quote
  #3  
Old 08-06-2008, 11:10 AM
Michael Fritz
Guest
 
Default Re: Comments on collapseable function and procedures

"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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:25 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.