Stony Brook Modula-2 Orientation

This first tutorial will help you become familiar with the Stony Brook Modula 2 environment. This is a tweaked version of the tutorial starting on page 9 of the Stony Brook Utilities Reference Manual available in the lab.

Note for Mac Users

The Modula-2 environment we have installed on the lab Macs is called MPW; the environment is slightly different, but the Modula-2 code you type will be exactly the same. There is an old tutorial for the MPW Mac Modula-2 environment that may be of use. I don't have the resources to officially endorse the Mac environment; you're on your own, sorry! When backing up your work to an external drive (floppy, CD, USB keychain drive, etc.), beware that the name of the formatted disk must not have any spaces, periods, slashes, apostrophes, colons, or quotes in it. This restriction does not apply to filenames, only the disk name. Store your files in a subdirectory on the disk, rather than in the root directory. Also, if you want to read your disk on a PC, you'll need to make sure it's formatted as a PC disk and not a Mac disk. Macs can read PC disks, but PCs can't read Mac disks. C'est la vie.


Experiment using the Windows operating system until you can

Starting Stony Brook Modula-2

You are now ready to run Stony Brook Modula-2.

There's nothing special about the sample project file; you can also make your own by selecting "File->New Project" from the Stony Brook menubar. You do need to make sure the project is set for a console program: "Options->Linker Options", Win32 tab, check Console Application. See p.11 in the Stony Brook Utilities Manual for more details.

Creating and Editing a New Program

Typing the Program

Compiling and Debugging the Program

Running the Program

Files Created

Take a rest for a day or two, but come back again this week and do the next part to continue your orientation. You need to get going on your first assignment as it will be due next week.

Printing Hard Copies

There are some simple ways that you can use to get a copy of the output from your program onto a piece of paper. Other methods will be discussed at a later date. These are the simple ones; more powerful and versatile ones take more work.

Windows Stony Brook Menu Reference

There are descriptions of all of the menu options that can be chosen from within Stony Brook starting on page 39 of the Utilities Reference Manual.

Further Practice

You can get some more familiarity with the Stony Brook interface and with the Modula-2 language by copying some material from the textbook and compiling and running it. You're going to be spending a lot of cozy-time with the Stony Brook interface this semester, so get to know it and be friends!