From COBOL to OOP

Delphi and Jbuilder
This appendix gives a short introduction to the development environments included on the book CD, explaining a few important basics so that you can use them to work on the exercises. Each of the two development environments is illustrated by a simple example, dealing mainly with input and output operations. All programs should be designed on the basis of the following sample.
Start the Delphi system. From the File menu, select Open. In the dialog box that appears next, select the path Delphi\SampleProject on your CD and select the file Sample.
Sample project
A new input window appears, showing an empty Pascal program frame. The first step is to save the project under a new name. To do this, select Save As from the File menu. Select a meaningful name, such as Exercise0, and save the file to a directory of your choice.
Now you are ready for programming. A short demo program could look like this:
<a name="784"></a><a name="page296"></a><i class="emphasis">// Markus Knasm ller, 8.1.2003// This program reads two numbers and outputs the sum;// it serves as a demo program (Exercise0)</i>program Exercise0;var a, b, sum: Integer; dummy: Char;begin Write('Please enter the first value:'); ReadLn(a); Write('Please enter the second value:'); ReadLn(b); sum := a + b; Write('The result is:'); WriteLn(sum); <i class="emphasis">// an alternative would be WriteLn(a + b);</i> Read(dummy); <i class="emphasis">// required to keep the result</i>end.