If you install Micro Focus Personal COBOL for Windows onto your PC the default folder location will be C:\PCOBWIN
Remember that in DOS notation "C" is your system's hard drive and "A" is your floppy disk drive. If you have other devices installed, such as CD-ROM or Zip drives, or are attached to a network these may be labeled as drives "D", "E", "F", etc.
See Appendix B of your text book for detailed instructions for installing the software on your computer.
Once the software is installed you may access COBOL from your Start menu. Click the Start button, then point to Programs. On the Programs submenu point to Personal COBOL.
To put a "shortcut" to Cobol on your desktop click the Start button. Point to Programs. On the Programs submenu right-click on the Personal COBOL folder. Then click Open. This window should open:
Right-drag the
icon onto
the desktop. On the
pop-up menu select Create Shortcut Here.
|
|
The development environment is called "Animator". Click on Personal COBOL to begin an Animator session. |
When Animator opens take a look at the menu bar and toolbar buttons across the top of the window.
The pulldown File menu includes the New command which allows you to create a new file. Close allows you to close the current file without exiting from Animator. Notice that there are two commands to open existing files: Open for Edit and Open for Execution.
If you Open for Edit Animator will look for files with a .CBL extension. These are source code files. They may be edited and compiled, but cannot be run as programs. When you are ready to run your program you must be in Open for Execution mode which allows you to run a program as well as edit it. When looking for files to execute Animator is looking for file names with the .INT extension.
The default mode when you open a new file in Animator is Edit and Execute.
If you are in Edit mode and want to run your program you must first compile it, then select Open for Execution from the File menu, open the corresponding .INT file, and then choose Run from the Compile/Run pulldown menu.
As you type in the source code for your program you will find the functions on the pulldown Edit menu useful. These include the familiar Cut, Copy, Paste, Undo, Find and Replace, etc. You may also notice some helpful old friends on the toolbar.
The first five buttons on the toolbar should look familiar to you from other Windows applications. The first button allows you to Open a file, the second allows you to Save to disk. The next three buttons are your Cut, Copy, and Paste functions.
After you have typed in your program you need to compile it. The
compiler checks the syntax and creates an executable file. To compile
your program pull down the Compile/Run menu and select Compile
Program. Or, you can simply click on the
button.
The compiler will highlight any syntax errors in your code. You
can click on
buttons
on the toolbar to move to the previous and next error.
The compiler can find syntax errors in your code. After you remove all
the syntax errors and get a clean (no errors) compile you next have to
test for logic errors by attempting to execute your program. You do
this by selecting Run from the Compile/Run menu. Or,
you can click the
button on the toolbar.
When you run your program the output appears in a separate window.
If you wish to run your program again you must select Restart Application from the Compile/Run menu.
When you are trying to debug (find the logic errors in) your program
you may want to step through your program one instruction at a time. To
do this select Step from the Compile/Run menu or
click the
button on the toolbar.
As you step through your program you can examine the value of a particular data item by double-clicking the name of the data item anywhere it appears in your code.