Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] How to use file templates?

Hi all,

I'm trying to use a file template, but it doesn't work as I expect.
I've created a template for makefiles and added it under 'Window > Preferences > C/C++ > Code Style > Code Templates > Files > Fortran Source File'.
(I first tried adding it under a separate category 'Makefile' instead of under 'Fortran Source File', but then I cannot select it when creating a new (source) file under my project.)
When I now create a new source file and give it a name which doesn't end with one of the recognised fortran file extensions the following warning is shown at the top of the dialog: "File name is discouraged. File extension does not correspond to known source file types", and even though I select my makefile template to be used, the newly created file is empty. In fact, even if I select any of the pre-defined templates this fails. So templates are only applied if the new file has a fortran file extension.

I can work around this by creating the new source file with a name ending in one of the fortran file extensions, and then rename it afterwards to my liking. The file is now created according to the chosen template. So this method works, but obviously it is not ideal.

So, my questions are:
1. Is there any way to create a new file using one of the templates other than those under 'Fortran Source File'?

2. Can I create a new source file from a template, giving it a file name that doesn't end in one of the fortran file extensions?

Greetings,
Erik.


New Windows 7: Simplify what you do everyday. Find the right PC for you.

Back to the top