The EXPAND_PATH function is used to expand a simple path-definition string into a full path name for use with the !PATH system variable.
EXPAND_PATH accepts a single argument, a scalar string that contains a simple path-definition string, that the function expands into a list of directories that can be assigned to !PATH. This string uses the same format as the IDL_PATH environment variable (Unix, Windows) or logical name (VMS). This format is also used in the path preferences dialog (Windows, Macintosh).
The path-definition string is a scalar string containing a list of directories (and in the case of
VMS, text library files that are prefixed with the "@" character), separated by a special character ("
" for Unix and Macintosh, "
" for VMS, and "
" for Windows). Prepending a "+" character to a directory name causes all of its subdirectories to be searched.
If a directory specified in the string does not have a "+" character prepended to it, it is copied to the output string verbatim. However, if it does have a leading "+" then EXPAND_PATH performs the following steps, searching each subdirectory of the specified directory recursively for other subdirectories. All directories found that contain at least one file of the desired type are added to the search path.
IDL ensures only that all directories containing IDL files are placed in !PATH. The order in which they appear is completely unspecified, and does not necessarily correspond to any specific order (such as top-down alphabetized). This allows IDL to construct the path in the fastest possible way and speeds startup. This is only a problem if two subdirectories in such a hierarchy contain a file with the same name. Such hierarchies usually are a collection of cooperative routines designed to work together, so such duplication is rare.
If the order in which "+" expands directories is a problem for your application, you should add the directories to the path explicitly and not use "+". Only the order of the files within a given "+" entry are determined by IDL. It never reorders !PATH in any other way. You can therefore obtain any search order you desire by writing the path explicitly.
Set this keyword to return the result as a string array with each element containing one path segment. In this case, there is no need for a separator character and none is supplied. Normally, the result is a string array with the various path segments separated with the correct special delimiter character for the current operating system.
Under the Unix operating system, the default value of !PATH is specified as "
", unless this default is changed by setting the IDL_PATH environment variable. When IDL starts, one of the first things it does is to run this default value through the EXPAND_PATH function to obtain the actual value for the !PATH system variable. The following statement shows how this expansion might look (assuming that your IDL is installed in
Executing Program Files and .