Creating a new template based on selected code

You can create new templates based on selected code to enable you to use custom code snippets.

About this task

Note: Custom code snippets (and the shortcuts that invoke them) are used in conjunction with content assist to type frequently used code constructs quickly. For example, suppose you defined a code snippet for the IF/ELSE/ENDIF macros in the list of templates with the name ifelse. The shortcut that would invoke this code snippet is ifelse. In the z Systems® LPEX Editor, you can type ifelse, and then press Ctrl + Space to insert the entire code block for an if else statement into the source file.

To create a new template based on selected code, complete the following steps:

Procedure

  1. In the file that is currently open in the z Systems LPEX Editor, select the code on which you want to base a new template.
  2. Right-click the selected code to open the pop-up menu.
  3. Select Add as new template to open the New Template dialog box. The Template section in this dialog box displays the selected code on which you want to base a new template.
  4. In the Name field, type a name for the new template that you want to create. For example, if you want to create a template for if else macros, type ifelse.
  5. In the Description field, type a description of the type of code snippet that you want to create a template for. For example, if else macros.
  6. Click OK to add the new template to the list of available templates in the Templates preference page.