RAD Studio
ContentsIndex
PreviousUpNext
Code Templates

 

Code templates are commonly used skeleton structures that you can add to your source code and then fill in. You can also use standard code templates such as those for array, class, and function declarations, and many statements. 

You can also write your own templates for coding structures that you often use. For example, if you want to use a for loop in your code, you could insert the following template:

for :=  to  do
begin
end;

 

for (; ;)
{
}

To insert a code template in the Code editor, press Ctrl-j and select the template you want to use. You can also add your own templates to this collection.

To add a template:

  1. Choose ToolsOptionsEditor Options.
  2. Click the Source Options tab and then the Edit Code Templates button.
  3. In the Templates section, click Add.
  4. Type a name for the template after Shortcut name, enter a brief description of the new template, and click OK.
  5. Add the template code to the Code text box.
  6. Click OK.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!