Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28996 Discussions

Can I change the default Fortran template program?

yamajun2
Beginner
548 Views
Can I change the Fortran template program on Visual Studio?
I found a directory "C:\Program Files (x86)\Microsoft Visual Studio 8\Intel Fortran\Templates", but this is not the place.
I want to use my own template.

[cpp]!  associate.f90 
!
!  FUNCTIONS:
!  associate - Entry point of console application.
!

!****************************************************************************
!
!  PROGRAM: associate
!
!  PURPOSE:  Entry point for the console application.
!
!****************************************************************************

    program associate

    implicit none

    ! Variables

    ! Body of associate
    print *, 'Hello World'

    end program associate

[/cpp]

0 Kudos
2 Replies
Steven_L_Intel1
Employee
548 Views
Look under C:Program FilesMicrosoft Visual Studio 8Common7IDEProjectTemplatesIntelFortran There you'll find subfolders for the different project types. Under each of those is a "0" folder. In there is one or more ZIP files corresponding to the selections you can make (empty or sample).

Editing these is not supported, and if you update versions your changes will be replaced, but feel free to experiment. I don't know if you can simply add your own project type or you have to edit an existing one. Let us know how it works out.
0 Kudos
yamajun2
Beginner
548 Views
Look under C:Program FilesMicrosoft Visual Studio 8Common7IDEProjectTemplatesIntelFortran There you'll find subfolders for the different project types. Under each of those is a "0" folder. In there is one or more ZIP files corresponding to the selections you can make (empty or sample).

Editing these is not supported, and if you update versions your changes will be replaced, but feel free to experiment. I don't know if you can simply add your own project type or you have to edit an existing one. Let us know how it works out.

Steve,

Thank you!
It worked by changing "Program.f90" file under ProjectTemplatesCache. (The Zipped files might be expanded here.) This solution is enough for me.

Full path to the file is "C:Program Files (x86)Microsoft Visual Studio 8Common7IDEProjectTemplatesCacheIntelFortranConsole Application1041ConsoleApplicationSample.zipProgram.f90".

Thank you again!

Template: Program.f90
[cpp]MODULE m_$safeprojectname$
IMPLICIT NONE

CONTAINS
!---------------------------------------

!---------------------------------------
END MODULE m_$safeprojectname$
!=========================================
PROGRAM $safeprojectname$
USE m_$safeprojectname$
IMPLICIT NONE

STOP    
END PROGRAM $safeprojectname$
[/cpp]
Generted File:
[cpp]MODULE m_Console8
IMPLICIT NONE

CONTAINS
!---------------------------------------

!---------------------------------------
END MODULE m_Console8
!=========================================
PROGRAM Console8
USE m_Console8
IMPLICIT NONE

STOP    
END PROGRAM Console8
[/cpp]

0 Kudos
Reply