 |
These steps show you how to compile and execute a
COBOL program using Visual Studio.
- Start Microsoft Visual Studio.
- Choose File | New | Project and you will
see this screen:

- Click on COBOL Projects in the left pane and click
on Console Application in the right pane. Be sure that the top right corner says .NET Framework 3.5. Fill in the
project name (Name:) and click the Browse button to
select a directory for your project. Select a
location on your personal hard disk or on a USB
flash drive in a computer lab. Be sure that the box
labeled "Create directory for solution" is
unchecked. A new folder will be created in the
specified location with the project's name. Then
click OK. For this example, we assume drive D is
the flash drive we are using.
- You will see that a program skeleton has already been written for you. If you like, you can erase all that code. If you want to use free format to enter your code (that is, you don't want to follow the strict column rules, click on the last item in the Project menu (the last word will be Properties). You will see the following:
Change the Source Format setting to be Free. Click File | Close to remove the Properties window.
- You are now ready to type your program. To compile your program, click Build | Build
Solution.
- If there are error messages in the bottom
window, double-click on each message to go to the
location of the error in your file. Fix the errors
and build your program again.
-
Execute your program by pressing Ctrl-F5 or clicking
Debug | Start Debugging.
Use one of the following strategies to return to
your project after closing Visual Studio:
- double-click the solution file (which ends in
extension .sln), or
- choose Open | Project/Solution from the
File menu and choose the solution file (ends in
.sln), or
- select the solution from Recent Projects
at the bottom of the File menu.
|