CSCI 150

Home | | Course Schedule | | Assignments | | Lecture Notes

Free Pascal and the Programmer's File Editor.

The version of Pascal we’ll be using is located on your lab machine’s hard drive in a folder called FreePascal. We will type in our programs and run the Pascal compiler using the "Programmer's File Editor". To create, compile and run a Pascal program, follow these steps:

Creating the program:

1) Start up the Programmer's File Editor by double clicking the icon on the desktop.

2) Open a new editor window by choosing "New" under the "File" menu item

3) Type in your Pascal Program.

4) Save your Pascal program using a name that ends in ".pas". For example, my Hello World program is named "hello.pas". I recommend that you save to the D: drive while working in lab. At the end of the session you should copy all your files to your P: drive, and delete the files from the D: drive.

Compiling the program:

5) From the "Execute" menu, choose "DOS command to window..."

6) In the box labeled "Command", type in the following:

ppc386 d:\hello.pas

ppc386 is the command to run the PASCAL compiler. d:\hello.pas is the location and name of the file containing the program you want to compile.

7) In the box labeled "Directory", type:

d:\

8) Click OK--With luck, after a few seconds you will see a CommandOutput window that reports the compilation of your program. If there are errors in your program, the output window will report the errors. If this happens, you will have to fix the errors and recompile before you move on.

Executing the program:

9) From the "Execute" menu, choose "DOS prompt".

10) Switch to the D:\ drive

11) Type the name of your program. (E.g. type "hello")

12) With luck, the program should run and do what you programmed it to do!

Saving your work:

13) When you are done for the day, copy all your files to your P:\ drive, or to a floppy (on the A: drive.

14) Delete all the files from the D:\ drive by moving them to the recycle bin.