In GT.M, the name of the source file determines the name of the GT.M routine. The file-specification name of the object file is not required to match the name of the routine. Linking the object file makes the internal routine name (derived from the source file) known to GT.M. This can lead to potential confusion, however, since both ZLINK and auto-ZLINK use the name of the object file to find the routine. When the object file name differs from the name of the routine, auto-ZLINK generates a run-time error.
Example:
$ TYPE DM.M $ TYPE NAME.M WRITE "This is routine NAME.",! $ M NAME/OBJ=NAME1,DM $ GTM GTM>DO ^NAME1 %GTM-E-ZLINKFILE, Error while zlinking "NAME1" -GTM-E-ZLMODULE, Object file name does not match module name: NAME GTM>DO ^NAME This is routine NAME. GTM>HALT $ LINK DM,NAME1 $ RUN DM GTM>DO ^NAME This is routine NAME. GTM>DO ^NAME1 %GTM-E-ZLINKFILE, Error while zlinking "NAME1" -GTM-E-ZLMODULE, Object file name does not match module name: NAME GTM>HALT
Note that, in the above example, auto-ZLINK does link the object file to the image, even though it raises an error. The routine becomes available under the internal routine name.
If the name of the source file differs from the name of the object file, ZLINK and auto-ZLINK do not perform the source-object comparison as described in the previous ZLINK Operation Summary table.