Contents Previous Next Subchapters

Source Code Search Path
Syntax path
See Also which , autoexec

If the argument newpath is not present the return value of the path function is a character row vector containing the search path. If the argument newpath is present, the search path is changed to this value.

Search Path
The search path is a sequence of directory names separated by semicolons. Leading white space is ignored in each of the directory names. When searching for a source code file, O-Matrix first looks in the current directory for the file. If it cannot be found there O-Matrix looks in the directories specified by the current search path. These directories are searched in the order that they appear in the path. If the file name exists in more than one path, the first file found is chosen.

If you enter
     path("c:\omwin; c:\omwin\lib; c:\omwin\function")
O-Matrix will set to the search path to the three directories c:\omwin, c:\omwin\lib and c:\omwin\function. If you then enter
     include colsum.oms
O-Matrix will include the file c:\omwin\function\colsum.oms if you continue by entering
O-Matrix will respond
     c:\omwin; c:\omwin\lib; c:\omwin\function
If you continue by entering the clear command, O-Matrix will reset the path as specified in the autoexec file.

The directories specified by the path function can use the notation parent\..\ to specify the parent directory. If you enter
     path( [cwd, "\..\; ", path] )
the parent directory of the current directory is included in the search path.

There are two separate search paths, one is used for O-Matrix mode and the other is for Mlmode . If you are in O-Matrix mode, you can access the Mlmode search path using the function mlpath.