TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-80
Usage Considerations
Usage Considerations
SEARCH can appear in the compilation command or anywhere in the source code. A
SEARCH directive can extend to continuation lines, each line beginning with ? in
column 1.
Search List
The compiler sends the list of object files from each SEARCH directive to BINSERV.
BINSERV appends the file names in the order specified to the master search list for
the current source file.
You can clear the search list at any point in the source file by specifying SEARCH with
no file names.
At the end of compilation, BINSERV uses the files that remain on the search list to
resolve external references. BINSERV searches the files in the order in which they
appear in the search list. If a procedure or entry-point name that resolves an external
reference appears in more than one file, BINSERV binds only the first occurrence, so
the order in which you specify the files is important.
After a successful compilation, BINSERV binds the new object file. During binding,
BINSERV uses procedures from object files in the master search list to resolve any
unsatisfied external references in your program. If the external procedures also contain
references to other external procedures or to data blocks, BINSERV resolves them
from object files in the master search list.
Retrieving Global Initializations and Template Structures
You also use SEARCH to retrieve previously saved global initializations and template
structure declarations. For example, in the following compilation command,
USEGLOBALS retrieves global data declarations saved in file TALSYM by
SAVEGLOBALS in a previous compilation, and SEARCH retrieves the initialization
values from object file MYOBJ, which was also created in the SAVEGLOBALS
compilation:
TAL /IN myprog/ newobj; USEGLOBALS talsym, SEARCH myobj
As an alternative, you can place the SEARCH directive in the source code anywhere
before the BEGINCOMPILATION directive.
For more information on saving global data declarations, see the SAVEGLOBALS
Directive on page 16-75.