You can create templates for any file type that
Visual COBOL provides a new file wizard for.
Note: Using custom file templates is not supported for COBOL programs, COBOL JVM classes or interfaces in the COBOL JVM projects.
When you prepare a source file template, you can use a placeholder for the program name. This is replaced with the actual
program name when you are using the template to create new files.
To prepare to use a file as a template:
- In the IDE, create a file of the desired file type in your project and type in it the required code.
- You can replace the program name in any source files with the following string
<ProgramName>.
This is a placeholder that will be replaced with the actual filename when you are using the file as a template.
- Save the file.
To save the file to a templates folder:
- On your file system, navigate to the project folder in your workspace.
- Copy and paste the file into a templates folder (such as
/home/myfiletemplates (UNIX)).
Instead of saving the file in this way, you could export it from the IDE to your templates folder:
- In the IDE, select your project in COBOL Explorer.
- Click
File > Export.
- In the
Export dialog box, expand
General, click
File System, and then click
Next.
- Ensure the check box for your project is enabled in the left-hand pane.
- In the right-hand pane only select the file you would like to use as a template.
- In the
To directory field, specify the path to your dedicated templates folder (such as
/home/myfiletemplates (UNIX)).
- Click
Finish.
This saves the file to your templates folder.
Note: It is a good practice to use a single folder to store all of your templates. You can use any subfolder structure within that
location. When you want to use the templates, you need to configure the IDE preferences to search for templates in the templates
folder. The IDE will scan all subfolders of the templates folder, and will display the relevant project and file types in
a tree structure.