Here are some tips on handling projects and building COBOL applications in the Visual Studio IDE:
- Add Files to the Project
- Right-click the project in Solution Explorer. Choose
Add > New Item to create a new file from the supported types in the project directory. To add an existing file, choose
Add > Existing Item and browse to the location of the file to select it. This adds a link in the project to the file but does not copy it in the project directory.
- Application Configuration File
- Includes the environment variables and COBOL programmable switches used by your native COBOL application at run time. Right-click the project in Solution Explorer and choose
Add > New Item > Application Configuration File. To edit the file, right-click it in Solution Explorer and choose
Edit. This applies to native projects only.
- Assembly / Output name
- Choose
Project >
projectProperties and go to the
Application tab. Specify the name of the target file to build and the name of the output assembly in the
Assembly name/Output name field.
- Build Configuration and Settings
- The Visual Studio standard toolbar shows the active build configuration for your project, for example Debug or Release. You can specify settings for a particular configuration on the
COBOL tab in your project properties. To create new build configurations or edit the existing ones, choose
Build > Configuration Manager.
- COBOL Settings
- Use this to set the dialect, the source format and directives for the whole project. Choose
Project >
projectProperties and select the
COBOL tab.
- Compile Single File
- In
Solution Explorer, right-click the file you want to compile and click
Compile. This works for native code only.
- Compiler Directives
-
You can use directives to control the way the Compiler behaves: what output it produces, what code is compiled and how the compiled code behaves when it runs. To set directives, choose
Project >
projectProperties and select the
COBOL tab. Click in the
Additional Directives field and type the directives, separated with a space.
- Copybook Paths
- The locations in which the project searches for copybook files. To add copybook paths to the project, choose
Project >
projectProperties and select the
Copybook paths tab.
- Entry Point/Startup Object
- Defines the method entry of the application. Choose
Project >
myProject Properties and select the
Application tab. Specify an entry point for your project in the
Entry point/Startup object field.
- Errors Window
- Shows the errors, warning and messages created during edit or compile. Double-click on an error to position the cursor on the line of code that causes the error. You can get Help on the error if you point to the error number in the list and press
F1.
- Link and Run-Time Environment Settings
- Go to the
COBOL tab in your project properties and click
Link Settings. This is available only for native code.
- Output window
- Displays the status messages for the executed commands at build time. Display it from
View > Output.
- Stop a Build
- Choose
Build > Cancel.
- Resource Definition Script File
- Enables you to add non-executable binary data such as icons, version info, to your executable files. Create the resource script file (.rc) outside of Visual Studio and to add it to your project right-click the project in Solution Explorer and choose
Add > Existing Item. This applies to native projects only.