HP Pascal/iX Reference Manual (31502-90022)

12- 66
'[+]
file_name
[,
file_name
]...'
The compiler searches the
file_name
s (in the order
specified) for module definitions. If + is specified, the
compiler concatenates this list of file names to the
existing list (which was created by previous SEARCH
options). If + is not specified, this list of file names
replaces the existing list. (Note that + can only appear
before the first string.)
An empty string resets the search list to the default.
Default On MPE/iX: PASLIB.PUB.SYS
On HP-UX: /usr/lib/paslib
Module definitions for predefined modules are kept in the
system default module library (paslib), so you do not need
to specify the search options for these modules.
Location Anywhere before the
import
statement.
Pascal requires that lower level modules be included in the $SEARCH path,
even if the higher level modules do not use them. For example:
module a $search 'a.o'$ $search 'a.o, b.o'$
export module b module c
. import a import b
. export export
. . .
end. . .
. .
end. end.
Example
$SEARCH 'file1,file2','file3'$ {The search list contains file1, file2, file3.}
$SEARCH '+file4'$ {Adds file4 to the search list.}
IMPORT {The search list now contains file4.}
MOD1,MOD2,MOD3;
.
.
.
$SEARCH 'file5,file6', {Replaces old search list.}
'file7,file8'$ {Can span more than one line.}
<rev begin>
IMPORT MOD4; {The search list now contains only file5,}
. {file6, file7, file8.}
<rev end>
.
.
The SEARCH compiler option tells the compiler which files to search for
module definitions. It does not indicate to the linker which files
should be linked with the main program. All object files, or archives
and object files that appear in any search options in the main program
must be explicitly specified to the linker at link time.
Example
Program main(input,output);
$SEARCH ‘a.o,b.o,c.o'$ {All object files for lower level}
{modules must be included. }
import c;
.
.
.
end.