2011-03-31 13:59:18 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2003-11-28 21:50:02 +00:00
< html lang = "en" >
< head >
< meta http-equiv = "Content-Language" content = "en-us" >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
2007-12-05 12:28:32 +00:00
< title > Creating and editing templates< / title >
2003-11-28 21:50:02 +00:00
< link rel = "stylesheet" type = "text/css" href = "../help.css" >
< / head >
< body >
2012-09-19 17:16:24 -04:00
< div role = "main" > < h1 > Creating and editing templates< / h1 >
2007-12-05 12:28:32 +00:00
< p > Content Assist uses templates to enable you to quickly make use of commonly used code segments. < / p >
< p > To create a template:< / p >
2003-11-28 21:50:02 +00:00
< ol >
2010-03-31 01:34:27 +00:00
< li > Click < strong > Window > Preferences< / strong > .< / li >
< li > Expand < strong > C/C++< / strong > , expand < strong > Editor< / strong > and select < strong > Templates< / strong > .< / li >
< li > Click < strong > New< / strong > .< p > < br >
2007-06-19 19:34:42 +00:00
< img src = "../images/code_templates_new.png" alt = "Creating a new Code Template Window" > < br > < / p >
< br >
2004-04-26 15:41:43 +00:00
< / li >
2004-06-24 10:49:13 +00:00
< li > < p > Do the following: (if required)< / p >
2003-11-28 21:50:02 +00:00
< ul >
2010-03-31 01:34:27 +00:00
< li > In the < strong > Name< / strong > field, type a template name.< / li >
< li > In the < strong > Context< / strong > drop down list, select the context type for the new template; either < strong > C/C++< / strong > or a < strong > Comment< / strong > .< / li >
< li > In the < strong > Description< / strong > field, type a description for the new template.< / li >
< li > In the < strong > Pattern< / strong > field, type the code for this template.< / li >
< li > Click < strong > Insert Variable< / strong > to add a variable from the list to the code you have entered in the < strong > Pattern< / strong > field.< / li >
2003-11-28 21:50:02 +00:00
< / ul >
< / li >
2010-03-31 01:34:27 +00:00
< li > Click < strong > OK< / strong > .< br >
2007-12-05 12:28:32 +00:00
The new template displays in the Templates list. < / li >
2003-11-28 21:50:02 +00:00
< / ol >
2007-12-05 12:28:32 +00:00
< p > To edit a template:< / p >
2003-11-28 21:50:02 +00:00
< ol >
2010-03-31 01:34:27 +00:00
< li > Click < strong > Window > Preferences< / strong > .< / li >
< li > Expand < strong > C/C++< / strong > , expand < strong > Editor< / strong > and select < strong > Templates< / strong > .< / li >
< li > Click < strong > Edit< / strong > . The Edit Template dialog opens.< p > < br >
2007-06-19 19:34:42 +00:00
< img src = "../images/codetemplates_example.png" alt = "Editing a Code Template" > < br > < / p >
< br > < / li >
2003-11-28 21:50:02 +00:00
< li > < p > Do the following:< / p >
< ul >
2010-03-31 01:34:27 +00:00
< li > In the < strong > Name< / strong > field, change the template name to create a new
2003-11-28 21:50:02 +00:00
template based on the current template. < / li >
2010-03-31 01:34:27 +00:00
< li > In the < strong > Context< / strong > drop down list, select the context type for the new template; either < strong > C/C++< / strong > or a < strong > Comment< / strong > .< / li >
< li > In the < strong > Description< / strong > field, change the description of the code
2003-11-28 21:50:02 +00:00
template to reflect your changes.< / li >
2010-03-31 01:34:27 +00:00
< li > In the < strong > Pattern< / strong > field, edit the code.< / li >
< li > Click < strong > Insert Variable< / strong > to add a variable from the list to the
code you edited in the < strong > Pattern< / strong > field.< / li >
2003-11-28 21:50:02 +00:00
< / ul >
< / li >
2010-03-31 01:34:27 +00:00
< li > Click < strong > OK< / strong > .< / li >
2003-11-28 21:50:02 +00:00
< / ol >
2011-03-31 13:59:18 +00:00
< p > < img src = "../images/ngconcepts.gif" ALT = "Related concepts" width = "143" height = "21" >
2003-11-28 21:50:02 +00:00
< br >
< a href = "../concepts/cdt_c_content_assist.htm" > Content Assist< / a > < / p >
2011-03-31 13:59:18 +00:00
< p > < img src = "../images/ngtasks.gif" ALT = "Related tasks" width = "143" height = "21" >
2003-11-28 21:50:02 +00:00
< br >
< a href = "cdt_t_contentassist.htm" > Using Content Assist< / a > < br >
2007-12-05 12:28:32 +00:00
< a href = "cdt_t_imp_code_temp.htm" > Importing and exporting templates< / a > < / p >
2011-03-31 13:59:18 +00:00
< p > < img src = "../images/ngref.gif" ALT = "Related reference" width = "143" height = "21" > < br >
2007-12-05 12:42:33 +00:00
< a href = "../reference/cdt_u_code_temp.htm" > Templates page< / a > < / p >
2003-11-28 21:50:02 +00:00
< p >
2007-06-19 19:34:42 +00:00
< img src = "../images/ng00_04a.gif" ALT = "QNX Copyright Statement" >
2003-11-28 21:50:02 +00:00
2012-09-19 17:16:24 -04:00
< / div > < / body >
2003-11-28 21:50:02 +00:00
< / html >