Reference is a terminal, command statement that occurs not only in command scripts, but
also as a substatement of the Compile statement and the Refactor statement.
It explicitly loads a reference file into the current storage area. The typical reason for
using this statement with VB6 project translations is that the project file does not explicitly
list an external library whose members are in fact being referenced in the source code. In the
case of ASP web translations, the external references are not explicitly defined; therefore,
they must be supplied in the translation script using Reference statements.
The attributes of the Reference statement are as follows:
Attribute
Description
Id
This attribute simply identifies the external library to be loaded via its local
filename like mso.dll or msword9.olb or mscomctl.ocx or
msado20.tlb. The reference is then loaded using the same conventions
as those used when loading an external referenced within a VBP project file.
Location
This attribute specifies the full pathname of an external library as opposed
to its simple local name. The file is loaded directly without going through the
normal search logic and without first ensuring that it has not yet already been
loaded. This attribute should only be used in special utility contexts. Note that
when using this attribute the Id attribute, which is used internally to
identify the external must be specified as well.
Registry
This flag attribute, when specified as Off, requests that the normal
Libname registry search not be performed on the specified Id.
The loading of references via the Id attribute proceeds in exactly the same manner as if
they were loaded via a VBP file. First, before any code can be compiled or external reference
loaded the environment within which the compilation is to occur must be established. See the description
of the LoadEnvironment statement for details. Second, the registry is checked for a Libname
entry. This entry is used to change the id under which a given external reference is processed.
Third, a check is made to see if an external with the specified id has already been loaded. If so,
it is not loaded again. Fourth, the extension xml is added to the back of the id to form
a reference script filename and the file is looked for using the standard search order. That order
is target location, local location, system location, and language location.
Fifth, if located, the reference script is loaded. Sixth, the reference script filename is modified
to be preceded by Mig. to form the name of a possible refactoring file which would contain
statements modifying the characteristics of the components in the external. If located, this file
is loaded as well.