This tutorial introduces the Visual Studio IDE.
This tutorial introduces the Visual Studio IDE, and shows how to create, build and debug a simple console application using supplied COBOL programs that use ACCEPT/DISPLAY statements.
To run this tutorial, you must have both Microsoft Visual Studio and reUZE Developer installed.
To start Visual Studio:
The IDE is shown in the figure below, although the information displayed in the large pane will be different.

The large pane is where your solutions and projects will be opened. At the moment, this shows the Start Page, with up-to-date information on Visual Studio. When you start work, this pane is where your code is displayed.
The pane at the bottom is the Output window, where messages from the IDE and Compiler are displayed.
The right-hand pane is the Solution Explorer, which displays the structure of your solution and projects. At the bottom of the Solution Explorer pane are some tabs. Solution Explorer appears by default.
If any of these panes is hidden, you can show it from the View menu.
The first task is to create a solution and a project. A solution is a container holding one or more projects that work together to create an application. The solution has the extension .sln, and is a readable text file. Microsoft recommends you do not edit the file outside of Visual Studio.
A COBOL project has the extension .cblproj, and again this is a readable file, but Microsoft recommends that you do not edit it. Different types of project have different extensions, so for example a C# project has the extension .csproj.
In this section, you create a project and solution, as follows:
Notice that the Name and New Solution Name fields have the same name. Changing either one of them automatically changes the other.
For example, if you create a folder on your c: drive called tutorials, change the location field to c:\tutorials. The solution will be stored in a subdirectory Locking, according to the project name.
This creates a solution and a project. The Solution Explorer shows the Locking project. It contains:
You can add existing files to the project, as follows:
There are two default build configurations for each project type: Debug and Release. These configurations define how to build the project for the different situations.
To build the project for debugging and to run it:
Notice in the Standard toolbar at the top of the IDE, that Debug shows as the active configuration.
The Build option builds only those files that have changed since they were last built, whereas the Rebuild option builds all the files in the project, regardless of whether they have changed since they were last built.
.
A console window opens, showing this character-based application running.
"5" is the code that tells this application to finish and the console closes.
Project properties define characteristics of the project and enable you to control a project's behavior among other things. Different properties are set by default for different types of projects.
If the Properties window is not visible, you can show it by clicking View > Properties Window.
A description of the selected property is displayed dynamically at the bottom of the Properties window. To turn this description on and off, right-click in the description.
The IDE provides debugging facilities, such as stepping, examining data item values and setting breakpoints. To see some of these facilities:
.
A console opens for running the built programs.
The source code for locking.cbl opens in the COBOL editor. The first statement DISPLAY SPACE is highlighted in yellow, with a yellow arrow pointing to it. This is the statement to be executed next.
.
This statement displays some information about the application in the console.
.
Step Over executes all the code for a PERFORM or CALL statement in a single step.
The console now appears and waits for your input.
Notice that the statement "EVALUATE CHOICE" is now highlighted ready for execution and that the value of the choice variable is now "5". You can see this by hovering over the choice variable in the Evaluate statement, and also by looking in the Autos pane at the bottom.
If the Autos pane is not visible, open it by clicking Debug > Windows > Autos.
This opens a separate pane, the Watch pane, which shows the values of watched variables.
You can close Visual Studio now. You do not need to explicitly save anything, because the files are automatically saved when you build them.
Copyright © 2009 Micro Focus (IP) Ltd. All rights reserved.