Figure 8. The code templates page of the settings screen.
What is a code template?
Code templates are one of the very powerful features of CA3. Basically a code template is nothing more than a piece of code. This code you can then insert in the program you are coding, at any place and any time, just by typing the code template shortcut and giving a call to the code template processor.
In this way you can insert 'often used' code in a few letters of typing, which decreases the release date of your project!
How do I edit these code templates?
As almost every window of CA3, this window is really easy to use... Push the Add button to add a code template, Delete to delete the selected code template and Edit to edit the selected code template. The edit and delete buttons are only enabled if they 'really' will do something, just as the apply button.
Figure 9. Add a new template
When you click the Add button, this screen will pop up. You can give a shortcut name and a description to your new code template. The shortcut is used when you want to insert a code template into your source as mentioned before in this topic. The description part is used by the main window of CA3 (in the Template item of the main menu, we'll get to this later)
Insert an ampersand (&) in the description to let the item have a hotkey, e.g. when you have this description: My &code template, and you pop up the template menu in CA3, it will be displayed as My code template. In this way, when you press the 'C' key, CA3 will insert the My code template template.
The little editor is available when you've selected a code template in the list box. If you've done that, this edit box is always waiting for your input. You enter the actual code for your code template in this edit box. Also this edit box 'auto saves' the template when you e.g. select another template.
Insert a pipe symbol ( | ) in the code of your template to indicate the cursor position after inserting the code template into your source...
Although the edit button seems to have something to do with the edit box, this is not true. As said, the edit box is always edit able when a code template is selected. The edit button let's you edit the Shortcut name and the Description of the code template that's been selected in a screen similar to the screen showed in Figure 9.