[Lazarus] Hiding Comments

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Feb 16 08:53:30 CET 2010


Hello Theo,

> I think it would be helpful to hide all comments at times, because while
> helpful, they make reading the actually working code a lot harder.


That's why I prefer external documentation like is done with FPC and
Lazarus projects - using XML files.

Alternatively, keep most of your comments above the
method/function/procedure. If you want to hide them automatically, simply
wrap them with {%region} so it enables code-folding.

eg:

 {%region 'comments hidden by default' -fold}
 { This is my very long comment that goes on for many lines...}
 {%endregion}
 procedure MyProc;
 begin
   ...
 end;


The '-fold' in the %region line will tell the IDE to code-fold than region
by default. I use this for all code auto-generated and managed by fpGUI's
UI Designer.


The last solution is to simply not comment your code! Make it the next
developers problem. :-)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/





More information about the Lazarus mailing list