[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppBuilderCodeTemplate
When you use the key shortcut CTRL-J, a menu pops up with your code templates.
I (Bilderbikkel) don't know how to do it yet
.
Note: if you enter an unparsable XML statement, you'll get the error 'Access Violation at address 5539BA08 in module 'codetemplates100.bpl'. Read of address 00000000'. This error will remain until restarting; fixing the XML code will not remove this error.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppBuilderCodeTemplate
Code template
A feature in C++ Builder to generate templated code.When you use the key shortcut CTRL-J, a menu pops up with your code templates.
Make your own code template
C++ Builder 6
You generate the templates in 'Tools | Editor Options | (tab) Code Insight | Add template'. One of my templates is:
for (int i=0; i!=|; ++i)
{
}
The bar '|', denotes where your cursor will be when you called this code template. I called this template 'i'.C++ Builder 2006 and Turbo C++ 2006
Go to 'View | Templates' to view the templates. Choose 'Edit' to edit one. The templates must be written in XML.I (Bilderbikkel) don't know how to do it yet
Note: if you enter an unparsable XML statement, you'll get the error 'Access Violation at address 5539BA08 in module 'codetemplates100.bpl'. Read of address 00000000'. This error will remain until restarting; fixing the XML code will not remove this error.
Examples
Below is the for-loop code template, supplied with Turbo C++ 2006.
<?xml version="1.0" encoding="utf-8" ?>
<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
version="1.0.0">
<template name="for" surround="true" invoke="auto">
<point name="expr1">
<hint>
initial expression
</hint>
<text>
i = 0
</text>
</point>
<point name="expr2">
<hint>
loop condition
</hint>
<text>
i <= 10
</text>
</point>
<point name="expr3">
<hint>
loop expression
</hint>
<text>
i++
</text>
</point>
<description>
for statement
</description>
<author>
Borland Software Corporation
</author>
<code language="C" context="methodbody"><![CDATA[for ($expr1$; $expr2$; $expr3$) {
$selected$$*$$end$
}
]]>
</code>
</template>
</codetemplate>
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
