This tutorial walks you through the steps to create your first Hello COBOL World application and demonstrates the basic features of the Visual Studio Integrated Development Environment (IDE).
If this is the first time you have started Visual Studio on your machine, you are prompted to specify default environment settings. Choose General Development Settings.
The windows you see open in Visual Studio and their layout depend on whether you have used the IDE before and on the edition of Visual Studio that you might have installed on your machine. You can move, resize and minimize windows which is why they may not look exactly like described here.
You can see:
A solution is a holding place for projects that relate to the solution. For example, the solution you are going to work with contains two projects - a batch project and an online project.
If you wish to restore the default windows layout of the IDE, click
.This creates a solution (which is a container for projects), and a project with a skeleton COBOL program. The solution and the project are displayed in the Solution Explorer view. The program is loaded in the Visual Studio editor.
To demonstrate how you create new files in a project, you are going to create a new source file that will hold the source code for the Hello COBOL World application:
This creates the file in your project and opens it in the editor.
Confirm that you want to delete the file.
This creates a new line in the file and the cursor is positioned right after the grey margin area in the AB area. By default, the COBOL editor is configured for smart editing and does not position the cursor in the COBOL margins areas.
display 'Hello COBOL World!'.
Now that you have added some code that can be executed, you can build your project. Because this is a project that creates a console application, building will produce an executable file in a subfolder of the project which is specified in the project's properties. To build the application:
The progress of the project build is displayed in the Output window. It shows that the build has succeeded and where the executable file is. If there were any issues with the build, the IDE displays the Error List window. You can open these windows manually from the View menu.
Your project was built successfully so you can now run the application.
To run the application from Visual Studio:
This opens a command window that shows Hello COBOL World.
Preserve this solution and project because you are going to use it again for a different demonstration included in this Introduction.
Continue with the next tutorial, Configuring the Hello COBOL World Application, which shows how to configure a project to locate the copybooks that are not in the project directory.