Text templates





1C:Enterprise Designer supports creation, storing, and quick insertion of frequently used text fragments. Such fragments are called templates. Developers can use the Text templates window for managing the templates.

Templates are stored in files. Developers can create new template files or use existing ones.

Each template has a static part and a dynamic part. The static part is not changed, it is inserted in the text exactly as it is specified in the template. The dynamic part varies depending on the usage context.

Developers can create new templates and edit existing ones. The template editor window displays the list of templates and the text of the selected template. The dynamic parts are enclosed in angle brackets <>.

While editing a module or text document, you can quickly insert a template after typing a sequence of characters that belongs to the template. For example, you can type "If" in a module and then press a key to insert the "If" template.

Since two templates include "If" are found, you are offered to select the template and specify the dynamic part content.

Then the following text is added to the module:

You can insert any template by selecting it from the context menu.

You can use the query builder and the formatted string wizard for generating dynamic parts of text templates.

For example, the dynamic part generation in the following template includes calling the query builder.

And the following template calls the formatted string wizard.

Text templates can also use the configuration object selection window for filling the dynamic part.

Therefore, text templates greatly simplify reusing script fragments, while leaving the option to change their dynamic parts with help of other interactive development tools. In other words, the templates act as "wizards" that facilitate the creation of application modules.

See also:

Comments
0
Add comment