On creating a new project, the following files are created in the file system with the following structure:
... |_Location |_Solution | |_Name | |_bin | | |_x86 | | | |_Debug | | | |_Release | | | | | |_x64 | | |_Debug | | |_Release | | | |_obj | | |_x86 | | | |_Debug | | | |_Release | | | | | |_x64 | | |_Debug | | |_Release | | | |_Properties | |_Solution.sln |_Name.cblproj |_Name.dep |_Program1.cbl
If you select the Create Directory for Solution option when creating a solution, the structure is slightly different.
In the Solution folder:
In the Name folder:
Debug and Release are standard build configurations that you launch from the Visual Studio task bar. They use a different set of compiler directives as well as outputting different files. You can create your own build configurations by clicking Build > Configuration Manager and choosing New from the Active solution configurations drop-down list.
The x86 folder exists because the default output platform is 32-bit. If you change this to be 64-bit, you will instead find your ouptut in an x64 folder.
If you open a command prompt and change to the Location folder, you can execute the msbuild command, without needing to specify the .cblproj file.
A solution is a container holding one or more projects that work together to create an application. The solution has the extension .sln. A COBOL project has the extension .cblproj and a C# project has the extension .csproj.
Solution Explorer shows the solution that is open and the projects therein.
You can use the project's properties pages to display a list of the files in your solution with file details like output file type and location, COBOL dialect, and the number of errors generated by the file. To display the properties, click
.The COBOL editor provides help such as column cut and paste, and background syntax checking, which underlines errors with red wavy lines (also known as "squigglies"), which you can then hover over to display details of the syntax error.
When you are editing, you can insert code snippets and navigate forward and backward quickly, and the Find All References option enables you to search for references of any COBOL data items, section and paragraph names in the solution.
You can customize the editor to display line numbers, adjust colorization, tabs, and margins, from the
page in .When developing code, the editor provides IntelliSense that helps you write syntactically correct code and, in managed code, helps when you need to type more complicated constructs, such as the code to override the members that a class inherits from a base class or the code for implementing an interface.
The Light Bulbs feature for implementing an interface helps complete incomplete interface declarations. A Light Bulbs appears at the beginning of the declaration: click it and choose the missing member(s) of the inheriting interface.
When you encounter a COPY statement, or data item that is defined in a copybook, if you put your cursor on that code and press F12 the appropriate copybook opens in the editor at the relevant line. You can also do this by right-clicking the line and selecting Show copybook name.
Many Compiler directives are set automatically by certain configuration options in the IDE, but you can explicitly add directives to your project. Right-click on the project in Solution Explorer and choose Properties. In the COBOL tab, you can see directives that are set by the IDE in the Build Settings text box. Enter others in the Additional Directives text box as a space-separated list.
If you use a separate text file to manage your directives, you can reference this instead by entering the USE"directives file" directive. You should enter a relative path.
Build configurations define how to build a project or solution. There are default configurations of Debug and Release for each project type, and you can create your own specific configurations.
The Output window shows the results of your build together with errors. You can double-click an error and navigate directly to the appropriate line in the source code. You can do the same from the Error List.
When you debug the application, you can step through the code, hover over a data item to see its value, and watch data item values in a variety of ways. You can specify breakpoints on a range of conditions, such as when an expression is true or changes, or when a line is hit a specified number of times.
In native code, you can set COBOL watchpoints on data items and watch for changes in the area of memory associated with the watchpoints. When the memory changes or a condition associated with the watchpoint has been met, the debugger breaks on the line that follows the line on which the data change occurred.
Also in native code, you can use the Memory window to watch the contents of the memory that is associated with data items or expressions.