
Using Compaq Visual Fortran
The Compaq Visual Fortran development environment has many similarities to the Microsoft Visual C++
development environment. The three main areas used when writing a program are the workspace, the
project and the source file. A workspace is simply a container to easily organize projects. A project is a
container to hold any number of source files. Typically, all the source files in a project are interrelated,
often to produce a single executable program file. The hierarchy of areas, listed from highest to lowest, is
the workspace, then the project and finally the source file.
You can build many different kinds of projects with Visual Fortran. For our purposes only one, the
console application, is of interest. A Fortran console application (.exe) is a character-based program that
does not require screen graphics output. It looks similar to a program running on a UNIX workstation or a
terminal connected to a mainframe computer. Fortran console projects operate in a single window, and
let you interact with your program through normal read and write commands. Console applications are
better suited to problems that require pure numerical processing rather than graphical output or a
graphical user interface. This type of application is also more portable to other platforms than other types
of application.
Creating a Workspace
1. Once the Visual Fortran program has been started, choose the “New…” option from the “File”
dropdown menu at the top of the screen.
2. A new dialog box will appear. Choose the “Workspaces” tab.
3. Type a name for your workspace in the “Workspace Name:” edit box, for example, ece3331fort
might be a good choice.
4. Pick a location to save using the browse button (a small button with an ellipses on it). The
directory must exist before you can choose it. Visual Studio will create a directory within the
directory you choose, and it will be assigned a name identical to your workspace name.
5. Click “OK” to create the workspace.
Creating a Project
1. To create a project within your workspace, choose “New…” from the “File” dropdown menu. A
dialog box will appear.
2. Make sure you are on the “Project” tab. This should be the default tab when the dialog box
appears.
3. Select “Fortran Console Application” from the list.
4. Type a name for your project in the “Project Name:” edit box, for example, cp6 might be a good
choice.
5. Pick a location to save using the browse button (a small button with an ellipses on it). The
directory must exist before you can choose it. Visual Studio will create a directory within the
directory you choose, and it will be assigned a name identical to your project name. For example,
you could choose the ece3331fort workspace created above. Using this kind of directory
structure is a good way to organize several projects within a single workspace.
6. When the next dialog appears, make sure to choose “An empty project” and click “Finish.”
7. Click “OK” for the next dialog box.
8. On the left side of the Visual Fortran application pane, choose the “File View” tab. Notice that
your newly created project is nested within the workspace. Notice that the words “cp6 files” are
in bold letters. This means that this is the current project, and any source files created will be
added to this project.
1