previous next top contents index framed top this page unframed
INTCOM compares two intmods to see if they are the same except for their compilation dates. The MODULE can be invoked interactively or it can be called from a program using the PROCEDURE $compareIntmods.
INTCOM has a strict notion of whether or not two intmods match; except for the compilation date and time fields embedded in the MODULEs, each pair of corresponding characters must be the same. This means, e.g., that if a MODULE is compiled and then one of its PROCEDUREs is recompiled without having been changed, INTCOM would report that the original version and the subsequent version of the intmod do not match, because the information about the recompiled PROCEDURE is not in the same place.
Next, INTCOM prompts for the target
abbreviation of the operating system for which the two intmods
to be compared were compiled.
Responding with <eol> means that the
MODULEs were compiled to run
on the host system (for the first pair
of intmods compared) or on the same system as the previous pair
of intmods compared (for subsequent comparisons).
INTCOM then asks whether to ignore legal notices.
If the answer is Y,
then the two MODULEs are considered the same
even if the text of their legal notices is different.
If the two intmods match, INTCOM reports that they matched
after comparing them.
Otherwise, it issues a short message indicating why they did not match.
In any event, INTCOM then prompts
for the names of two more intmods to
compare.
To exit INTCOM, you should type <eol> to the prompt for
another file name and <eol> to the prompt for a library name.
If one of the intmods examined in the previous comparison was in a
library, then when INTCOM
prompts for another pair of intmod names, it
assumes that the corresponding one of the intmods to be compared this
time is in the same library, and so it prompts for a MODULE name
without first prompting for a file name and then a library name.
For example,
if during the previous comparison, the first intmod was in a
library foo and the second was not in a library,
INTCOM assumes
that the first intmod it prompts for during the next iteration is also
in the library foo,
and prompts for the name of another MODULE in
foo.
It makes no such assumptions about the second intmod for which
it prompts.
If you type <eol> in response to the MODULE name
prompt, INTCOM prompts for the name of a file, as it did when it
was first run.
17.1. Interactive Use of INTCOM
If INTCOM is run interactively, it first prompts for
the names of the files containing the two
intmods. The first prompt asks for a file or
MODULE name. You can
type the name of the file containing the intmod, or if MAINSAIL
can derive the intmod file name from the
MODULE name alone, you
can type just the
MODULE name. If the intmod is in a library,
you can respond to the first prompt with <eol>, in which case
INTCOM prompts for the name
of the library file containing the intmod,
and then the name of the MODULE.
(If you answer * to the
MODULE name prompt, INTCOM compares all the
MODULEs in the library
to those with the same names in another library,
whose name it asks for.)
INTCOM goes through the same
sequence to get the names of both intmods.
17.2. Calling INTCOM from a Program
The interface to $compareIntmods is shown in Figure 17–1.
Figure 17–1. $compareIntmods
BOOLEAN
PROCEDURE $compareIntmods
(STRING file1,lib1,mod1,file2;
OPTIONAL STRING lib2,mod2,target;
PRODUCES OPTIONAL STRING msg;
OPTIONAL BITS ctrlBits);
$compareIntmods returns TRUE if and only if the two object MODULEs specified by its input parameters are the same except for their compilation dates.
file1, lib1, and mod1 specify the first intmod to be compared, and file2, lib2, and mod2 the second intmod.
file1 can specify the name of the intmod file, or just the name of the MODULE if MAINSAIL can determine the name of the intmod file from the MODULE name. If file1 is non-Zero, lib1 and mod1 are ignored. If the intmod is in a library, lib1 can specify the library's file name and mod1 can specify the MODULE name within the library, in which case file1 should be the empty STRING. file2, lib2, and mod2 specify the second MODULE in the same way that file1, lib1, and mod1 specify the first.
target specifies the target abbreviation of the operating system for which the two MODULEs were compiled. Target operating system abbreviations are listed in Appendix B of the MAINSAIL Language Manual. If target is omitted or is the empty STRING, the host operating system is assumed.
msg is set only if $compareIntmods returns FALSE. It contains a brief description of why the PROCEDURE did not return TRUE, such as that it could not find one of the MODULEs, or that one of them was not really an intmod, or that the MODULEs did not match.
The only ctrlBits bit currently defined is $ignoreLegalNotices. If this bit is set, comparisons of two MODULEs ignore the MODULEs' legal notices. Otherwise, the legal notices are compared.
MAINSAIL Utilities User's Guide, Chapter 17