Mirror

Add separator lines to your code with a Delphi's Code Templates (Views: 100)


Problem/Question/Abstract:

Add separator lines to your code with a Delphi's Code Templates

Answer:

In a source file with many procedures and functions in it, it is often hard to see where a routine starts and ends -- with all the begin and end statements. So you could add a comments line after each procedure, like this:

//------------------------------------------------------------------------

But who has time to draw all these lines? Well, Delphi has an answer to that problem: Code Templates. Just press CTRL + J followed by the shortcut for the template you want, and Delphi automatically writes out the code for you.

If you make a template for a comments separator line and set its shortcut to a symbol such as "-", then it will appear at the top of the list, since the list of code templates is sorted alphabetically. Now, in order to insert a separator line in your code file, all you have to do is press CTRL + J and ENTER.

<< Back to main page