
     Command:   WRITE

     Display:   SAVE MENU

This command allows you to store the menu in a specified file.
You are prompted to enter the name of a menu file.
If the file already exists,
a warning message is output and a popup is displayed to determine whether
to abort the command or replace the existing file.
If you choose to overwrite the file, the menu is output to the file.

While the menu is being written out, various checks are made on the menu data.
The object is to output a file which will not cause error messages to
appear when the file is read back in as part of an application.
Thus, when errors are detected, a message is output and
some corrective action is taken.

The MENUtool checks that every popup has been used and
that a popup exists for every reference;
unused popups and undefined references are not output.
Regardless of the order in which popups were defined, the popup data is output
to the file in an order such that there are no forward popup references.
The MENUtool only outputs those menu boxes whose upper left-hand corners
lie within the menu boundaries.
Finally, the tool ensures that there is at least one box on the first row
of the menu; if there isn't, a box is arbitrarily reassigned.

Other checks for errors which do not cause error messages when the file
is read in are not made on the file data.
For example, boxes are allowed to overlap, extend outside the menu boundary,
and/or have large gaps between or around them.

Note that miscellaneous changes which do not affect menu appearance may be
made to the menu file as it is read or written.
These changes may include the order of the lines in the file, the elimination
of comments and blank lines, continuation of lines, word spacing, etc.
Thus, the file which is written may differ from that which was loaded,
even if no changes were made.
