Start Here for the Tutorials | Maintaining and Creating Data Files |
The Integrated Development Environment (IDE) is where you compile, edit and debug all your applications.
This is the first session of the tutorial in the Getting Started book. You need to work through this before you do any of the others. You need to have read the chapter Start Here for the Tutorials before doing this one.
The IDE integrates all the tools you need for editing, compiling and debugging (known as "animating") COBOL applications. It contains extensive on-line documentation, both for the tools and for the COBOL language.
The easiest way to learn about the IDE is to complete a few simple tasks, so this session takes you through loading a project, compiling it, running it, and animating (debugging) it - that is, stepping through the source code.
A project is a file detailing all the files in your application, and how they should be compiled. A project is very easy to create, and makes compiling extremely quick and easy. You should create a project for every application, even the simplest. On disk, a project is recognizable by the extension .app at the end of its name. However, you never need to look at a project directly because, like most things in Net Express, you create and maintain it entirely using the IDE.
The folder where you keep the project for an application is called its project folder. You could keep the application's other files anywhere, since the project contains pointers to them, but it's usually convenient to keep them all in the project folder.
When you install Net Express, Setup creates, within the system folders containing Net Express, a folder called by default d:\Program Files\MERANT\Net Express\Base\Workarea. This folder is intended as your work area, and we suggest that you put all your project folders within it.
Net Express includes many demonstration applications. Some are used in the tutorials in this Getting Started book. Others are used in more advanced tutorials accessed via the online help. Most are in folders within d:\Program Files\MERANT\Net Express\Base\Demo, though a few for optional extensions are in other folders - for example the demos for Dialog System are in folders within d:\Program Files\MERANT\Net Express\DialogSystem\Demo.
If, when you installed, you specified a different name for the folder \Program Files\MERANT\Net Express, remember to use it in these sessions.
If you get partway through a tutorial and decide you want to start again, you can return the supplied files of demo to their initial state by clicking the demo's Initialize button in the full list of tutorials in the Net Express Help. You must have the CD-ROM or network connection from which you installed Net Express available. To get to the list, click Start -> Programs -> MERANT Net Express -> Help, and then in the Help Contents double-click Start Here! -> Tutorials, introductions and demonstrations, then double-click the subject area you want.
This does not delete files or folders created during the demo, but reinstalls the original versions of the supplied files.
Note:If you try to initialize a tutorial demo when a wizard is running in the IDE, you can get a protection violation. Before copying or opening demo files in the IDE, you should complete or cancel any wizard you have active.
The demo application used in this session is called Locking. A project file is supplied with it, and in this session you load the project and get the application running.
In this sample session you:
If you've entered the IDE by clicking the Run button at the end of installing, you may still have visible the main screen of the installation utility - the one with the Install, Installation Notes, and Exit buttons - though it may be hidden behind the IDE. You can close it by clicking its button, now or at any time - it won't interfere with this session
If not, then start the IDE as follows (this is how you will always start the IDE in future):
You may get a dialog box entitled Micro Focus Protection System, warning you that your license expires in a few days. In these sessions we will ignore this warning, but later you should load Net Express again and click the Help button on this screen for details of how to get a full license.
When you first load the IDE you get a Welcome screen as well as the IDE window. It has a check box you can set to show whether you want to get it every time. It enables you to choose whether to look at the Help file, or go straight into Net Express.
The Welcome screen closes. You now have the IDE on your screen. It is shown in Figure 5-1.
Figure 5-1: The Integrated Development Environment (IDE)
The large pane is where various windows such as project windows and editing windows will be opened. The pane below it is the Output window, where messages from the IDE and compiler are displayed. It has several tabs, of which the one you will use most is marked Build. When the Build tab is highlighted (that is, white), this window displays messages to show the progress of a build.
You can change the size and shape of the IDE by dragging the edges and corners. You can detach some panes and position them elsewhere in the IDE or separately on your screen - this is called docking or undocking them. See the appendix Windows Tips if you want to do this.
In doing the sessions in this book, be aware that if anyone has used the product on your computer before you, they might have moved panes from their standard positions.
To load the Locking project:
This opens the Open dialog box. If this is the first time you have started Net Express since installing, this displays the contents of d:\Program Files\MERANT\Net Express\Base\Demo. If it doesn't, change it to that directory.
The IDE opens a project window, displaying the files in the project. The left-hand pane is a tree view showing which files are created from which. The right-hand pane is a list of the files. You can drag the borders of the window; for example, you might want to make the right-hand pane wider to see more details of the files.
The .cbl files are the COBOL source files.
This opens a text window showing you the source code
This closes the text window, leaving the project window open. Alternatively you can close a window by clicking the Close icon at its top right-hand corner.
The .int files are executable files in intermediate code format (a Micro Focus executable format).
The IDE can also produce industry-standard .exe and .dll files, but .int code has the advantage of not needing linking - this makes it very quick to recompile individual programs when you are debugging a new application.
Files don't have to exist yet to be shown in the project. A project is analogous to a makefile or batch file that will guide the build. Since you haven't built the project yet, none of the .int files exist.
Building a project means compiling the files to an executable format. The format of the files created depends on the type of build and the options selected for the project type. Each project has two standard build types available, Debug and Release, and you can create your own build types as well.
This rebuilds all the files that have changed since the last time the project was built. Since you haven't built the project before, all the files are rebuilt. (The Rebuild All function on the same menu rebuilds all files in the project, whether they need it or not.)
This one function carries out the entire build. The correct compiler or translator is automatically called for each source file. In Net Express, the term "compilation" is generally used for any compilation, translation, conversion or preprocessing. Also, the term "source file" is used for any file that is the input to such a compilation.
Notice the button on the toolbar. The same symbol appears by Rebuild on the Project menu. Many commonly used functions on the menus have equivalent buttons on the toolbar. It's often quicker to use these. In these sessions we'll sometimes use the menus and sometimes the toolbar. If you leave the mouse pointer over a button on the toolbar for a moment, a brief explanation of that button appears. These explanations are called tooltips.
Messages in the Output window keep you informed about the progress of the build. The build is over when you see the message "Rebuild complete".
You use the Animate menu for both running and debugging. To run the application without debugging:
The Start Animating dialog box appears. You use it to specify where execution starts.
This dialog box appears for both running and debugging. In the IDE, running and debugging use the same underlying mechanism. In running an application within the IDE you are really using the debugging engine with the debugging features switched off. Consequently, running is controlled via the Animate menu, and observations we make about debugging will generally apply to running as well.
The button on the toolbar is equivalent to Run on the Debug menu.
This is a character-based application, so a new window appears at the bottom of the IDE. This window always appears for an application that does character displays. It is called the Application Output window, or character window. It is shown in Figure 5-2. You might have to drag the borders within the IDE to make this window bigger so you can see the whole display. If it is not big enough to show the whole display, there is a slider at its right-hand side.
Figure 5-2: The Application Output Window
In this session we are just showing how to build and run an application, so we will not use this application in any detail.
"5" is the code that tells this application to finish. The Application Output window remains so that you can see the application's final display.
You can check it has finished by clicking the Animate menu. The Start Animating and Run functions are not grayed out, as they are while an application is running. Click elsewhere on your screen to close the menu again.
(This Locking application is also used in one of the more advanced tutorials accessed via the online help, to demonstrate different ways of locking a file.)
This closes the Application Output window.
The IDE gives you an intuitive and graphical way to trace the execution of your code. It provides an extensive set of debugging (known as "animating") facilities. It is useful if the application isn't doing what you expect, or if you want to get familiar with an unfamiliar application. We will animate this application to see a few of these features:
The Start Animating dialog box appears.
The IDE opens a text window showing the source code for locking.cbl. The first statement is highlighted, ready for execution.
Step executes the next statement. This statement displays spaces on the text console, so it opens the Application Output window for this application. Windows might be moved about to make room for the Application Output window. You might have to drag borders within the IDE so you can see the source code again.
Run Thru executes all the code for a PERFORM or CALL statement in a single step.
Run to Cursor gives you a quick way of executing to a particular statement without setting a breakpoint. Execution does not reach the EVALUATE statement yet though - part of the code you have executed is an ACCEPT statement, and the application pauses there waiting for input.
The statement EVALUATE CHOICE is highlighted ready for execution.
This opens the Examine List, where you can see that its value is 5. From this dialog box you could create an individual monitor window for a data item, or change its value, or add it to the Watch list (which opens a window at the bottom of the screen).
Let's look at some ways you can configure the behavior of the IDE:
With this option set, putting the mouse pointer on a data item displays the item's value. This is quicker than using the Examine List, but you may not want this to happen every time you put the mouse on a data item. It's up to you whether you leave this option set or not.
The whole line is selected. You often use this when editing. However, you may not want the whole line selected.
Only the part of the line you dragged the mouse along is selected. Again, it's up to you whether you leave this option set or not.
There are many other options which you can set. We suggest you explore them when you are more familiar with using the IDE.
Execution halts on the STOP RUN statement at the end of the application.
Let's take a moment here to look at one way you can get help whenever you're using Net Express.
A popup appears telling you what the project window is for. Generally, whenever you see the Context Help button, normally or , you can use it to get quick context-sensitive help in this way. Of course, many screens also have a Help menu or Help button which takes you into the main help.
Close the project, by clicking in it to select it and clicking Close on the File menu, or by clicking its button. Closing a project window closes all its dependent windows - in this case, the text window displaying the source.
You can't close the standard windows like the Application Output window using Close on the File menu, and they do not have buttons (unless you've undocked them). Instead, right-click on the Application Output window and click Hide on the popup menu. Alternatively, click Dockable Windows on the View menu, then click by Application Output on the dialog box to delete the check mark, and click Close to close the dialog box. You hide these windows rather than close them - if you open them again, they are still displaying what was there before.
If you're planning to go straight on to another session, you can keep Net Express open. Otherwise, either click Exit on the File menu, or click the IDE's button.
Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Start Here for the Tutorials | Maintaining and Creating Data Files |