Borland 5.0 users I've updated sections of the document for those using Borland 5.0 (I've tested making projects/libraries using Borland 5.02).
Although you may not have thought deeply about it, all programs you've written using Turbo/Borland compilers have linked in code stored in libraries. Libraries are needed for I/O, math, graphics, and so on. Normally the IDE (Integrated Development Environment) takes care of the details of linking in the right libraries for you. When you use AP classes, and other classes that you decide will be useful for students to use (e.g., Dice, Date, etc.) student projects will need to link the code for these classes into the project. You can do this in one of two ways:
There are at least two distinct advantages to creating a library. The first is that a student project has only two entries in it (or more if the student herself creates a multi-file project): the apclass library and the student code. The second is that when the code is put in the library, only the code that's needed is linked and added to the executable program. This makes programs smaller.
To create a new project follow these steps -- be sure to see the instructions after these if you need to include AP classes, or other non-system classes that you're using.
The option for 'new project' is found under the File menu, there is a submenu labeled New, choose Project there. Proceed as with Borland/Turbo 4.5.
Borland/Turbo 4.5
From the Project menu choose New project. When the dialog box pops up, specify EasyWin[.exe] for the Target Type. You do this by clicking on this label. You shouldn't have to change either the Platform or the Target Model. The defaults of Windows 3.x (16) for Platform and Large for Target Model will work fine (these are the defaults on my machine).
To specify the name of the project, either use the topmost text field to type the complete path-name of the project, or use the Browse button to navigate among disks and directories, then type the name of the project in the browser dialog.
By convention, projects in Borland/Turbo use .ide as the suffix. You should use this since it will help the browser find your projects.
To remove a node, click on the icon with the right mouse button held down. This will pop up a little menu with several choices. Choose Delete Node and click on Yes when the dialog asks for confirmation.
To add a node to the project click on the project node. This is the node at the top of the project window with the [.exe] suffix. Click with the right mouse button, choose add, then navigate to the file you want to add. If you have only one file in the project, you're done and you can now compile and run using the options under the Project menu (compile, make, build) and the Debug menu (run) (or you can use the lightning bolt shortcut).
If you've added other source files, or are using include files that are in another directory, you'll need to modify the paths that the IDE uses to find source and header files. Use the Options menu and choose the Project sub-menu. In the section labeled Directories, which should be showing when you invoke the Project sub-menu, you'll see paths for source, include, and libraries. You'll need to modify the Include directories to add the directory in which the ap classes are found. Separate different directories using a semi-colon. On my machine I use the following, you'll need to modify this for your machine (I'm adding the directory c:\apclasses to the include path).
Order matters
If you want the apclasses directory to be included first, then be sure to put it before the system includes.
Finally, you can make any project have the same attributes as the last project that was loaded into the IDE. To do this, edit the file tcwin.ini typically found in the Windows subdirectory of your main drive. In the section labeled [Project] add the line
then each new project inherits the attributes of the last project. Alternatively, you can also use the same project (this is what I do), and just add a new, main source file.
In the instructions below you'll learn how to create a library you can use with all student projects.
Borland 5.0x users
You must specify
win 3.x(16)
under the platform section when creating the static library. This is because the easywin.exe project you'll use is NOT win32, but is a 16bit project. On my machine the default for platform is win32, so be sure to change this or you'll get an error message when your executable/project is compiled/linked.
Remember to alter the paths to include files using the Options menu if necessary.
The first step, adding two key files, is not needed in Borland 5.0x, do NOT add these files.
Borland/Turbo 4.5
This next step is essential to build a usable library. You must add the following two files to the project.
After you've created the library you'll want to include it in your project. Add it like any other node. If you need to modify paths to libraries to have the IDE find it, use the Options menu.
From this point on, students only need two entries in their projects: one file that contains a main function, and the library of all class implementations that you created above.