Fun Delphi 2007 Features: Live Templates

Introduced in Delphi 2006, Live Templates are like “RAD for writing code” by providing dynamic “live“ macros that guide you thru code structures. They can autofill elements and iterations, and they can even wrap themselves around and act on selected code. Hot key invokable, there are many Live Templates included in Delphi 2007. Under the hood, they are simple scriptable XML files but they are very powerful, they can query the compiler, invoke refactorings, and just about anything you can think of. So you can use the included templates or you can write your own code templates that can do all kinds of crazy things you might think of at 2am on too much coffee. There is even a template to guide you thru building templates :)


The templates are all hotkey invokable with Ctrl-J and they are also editable (just right click on them from the Templates View and select Edit) or can be used as samples to learn how to build new custom templates. Here is a list of all the Live Templates included in Delphi 2007:

/mypicture.jpg">

 

Posted by Michael Swindell on May 18th, 2007 under Uncategorized |



7 Responses to “Fun Delphi 2007 Features: Live Templates”

  1. yoyochen Says:

    Good demo. But it is too fast to understand what and how Love Templates do.

  2. Bill Says:

    While I love the templates and find them very useful, documentation on how to make them is almost non-existant (in Dephi 2007 help for just about anything either doesn’t exist or is so burried that I only use it as a last resort. I hope improved ones are in the works). I was able to work my way through creating one but only with the help of a few web sites. Is there any formal documentation on templates?

  3. Pete Says:

    Hi, this is very slick - I am new to delphi - any suggestions on get into delphi quickly, former xbase programmer…. feel out of place with it and connecting to databases has been a nightmare…

  4. Pawel Glowacki Says:

    Very good demo:-) What always impresses me the most with Live Template is the support for enumerated types in a "case" statement.

  5. Rodrigo Vega Says:

    Will be nice if it would include more templates for many other like message boxes, dialogs, open files routines, database programming tasks, etc, etc, etc…, maybe like in a tree like manner with categories based on the task you need to accomplish, I know I can added them but for a novice like me and many others new to Delphi it would be nice if it just came with them right out of the box. You guys are doing an excellent job, thanks.

  6. Captain Kirk Says:

    I would like to create the following template:

    Wrap the code at the END of the line

    with Begin End (Not selecting it).

    BE SomeCodeHere();

    begin

    SomeCodeHere();|*|

    end;

    But I cannot find a way to get the EOL

    to go there. I always get:

    begin

    |*|

    end;SomeCodeHere();

    I need some kind of CutToEOL() and

    Paste();

    Is there a way?

    Thanks.

    Kirk Out!

  7. masood anif Says:

    Better Look; Easy Declaration.

Leave a Comment

You must be logged in to post a comment.


Server Response from: dnrh2.codegear.com

 
© Copyright 2008 Embarcadero Technologies, Inc. All Rights Reserved. Contact Us  |   Site Map  |   Legal Notices  |   Privacy Policy  |   Report Software Piracy