|
Code Templates |
Top Previous Next |
|
The Code Templates feature allows you to create code snippets that you can insert in your source code. Code templates are created in the Options window, Code Templates tab. MZ-Tools offers the following ways to show a list of code templates that you can add to the source code:
The Code Template Selection window is the following:
You can also define a keyboard shortcut for each code template. When the keyboard shortcut is employed, the associated code template will be inserted into the code at the insertion point without showing the Code Template Selection window. Code templates can include predefined variables (such as author, current date, procedure name, cursor position after insertion, etc.) and can also include user-defined variables, that is, your own variables. When you insert into the source code a code template with user-defined variables, you are asked the values of those variables:
For example, in this case the code template (intended to create a collection class) includes a user-defined variable which is the name of the class of the objects that the collection will hold, used in the Item() and Add() methods. See Also: |