their names underlined.
Project Menu
This one is intended for team projects to keep track
of the members'
work. You will not be using it.
Directory Menu
Commands that involve the saving and reading of files
act on the disk
directory that is currently set as the
"default." You should at the time that
MPW ran, then the name of your disk will be
the default directory.
Show Directory...
This choice will display an information box with the
name of the
currently set default directory shown.
Set Directory...
This allows you to change to a different default
directory. Use this when
the number of files on your disk has grown to
the point where you need to
organize them in folders, one of which you
want to make the default directory
for operations for a particular session.
{directory
list}below
the dotted line...
This is a list of directories that have at one time or another
been the
default directory. To change the setting to
any one of these, simply select its
name from the list and the default will be
set to that name.
The M2 Menu
See the first part of the lab for a description of
the first three items. The
next three are similar to the first three,
except that they work on files instead
of on the active window. In order for the
compiler to work correctly, the file
must be of the form filename.MOD. In order for the link to work
correctly, it
must be given a file called filename.make. These files are chosen from the
standard file dialogue box that appears when
you select one of these menu
items. In the rare event that you want your
program also to run on an older
(68K) machine, you need to change the FatModeto either 68Kor to Fat.
Otherwise, or ifyou don't know what a Fat Mode is, don't
touch this.
active window and select "Print" from the
File menu. If the dialog box that
comes up lists one of the Lab printers
(Calvin or Hobbes) you can press the
"return" key, and everything will be taken
care of. If some other printer is
selected, cancel the print and select the
chooser from the applemenu. Select
the LaserWriter option and select a
LaserWriter from the list. Close this box,
returning to MPW and try printing again.
from your program onto a piece of paper.
(a) The simplest is to pull down the File
Printcommand while your
program is active. Alternately, you may wish
to save a copy of the window in a
file and print it some other time, say from a
word processor. You may also
select the entire document, Copyto the clipboard, switch to another program
(such as the MPW Shell), and Pasteit there, then print.
(b) A second, which you may find useful in conjunction with
the first is to
redirect the output as the program is
running. You do this by including the
line
FROM RedirStdIO IMPORT
OpenInput, CloseInput, OpenOutput, CloseOutput;
in the import section; the line
OpenOutput;
in your program before the first line
of the part that you want to be sending to
the file.
and, the line
CloseOutput;
in your program after the last part of
the program where you want output to
go to the file.
When the program runs, and encounters the OpenOutputcommand, a
standard output dialog box will be printed on
the screen. Type a file name, or
use the default already in the box Output and that is where all Writexx
statements will send their output
until the CloseOutputstatement is
encountered. If you choose the cancel box
without giving a file name, the
output will go to the screen as usual.
Note that if the CloseOutputis not included in your
program, this will not
work, and you may not even be able to delete
the flawed file from your disk
until the next time you restart the computer.
Note also that all output is sent to the file during this
time, so no
prompts printed by WriteString will appear on
the screen. We will improve on
this limitation later. Note also that this is
notstandard Modula-2; it has been
provided courtesy of TWU. You can now open
the file you have created, and
print it just as you did your listings above.
Other methods will be discussed at a later date. These are the
simple
ones; more powerful and versatile ones take
more work.
Well, don't just sit there -- experiment. You
can't really do any harm ... I
think.
MPW. This is fine, as long as you call the
originals "filename.MOD". From
here, you can use MPW on the files as stored
on the disk, or you can copy
from the word processing version to an MPW
window for compiling. In either
event, you are likely to want to use the word
processor for your
documentation (though you may keep this in an
MPW file as well) because of
the opportunity for using bold, italics, and
various type faces. If so, we
recommend NISUS or WORD—both of which
are available from all the
Macintoshes. You may also do documentation
and editing on a Wintel
machine as the Mac can read those files too,
provided your disk is DOS/Win
formatted.
the text, and that you can locate the files at
http://faith.csc.twu.ca/~rsutc/
in the CMPT14x directory. Practice by copying
some material from the
textbook and putting it into a file on your
own disk and by transferring the
files in the CMPT14x folder to your disk as
well.