MAINSAIL Language Manual, Section 47.18

previous   next   top   contents   index   framed top   this page unframed


47.18. setFileName

Figure 47–20. setFileName
PROCEDURE   setFileName (STRING modName,fileName);

setFileName is used to form or remove an association between a MODULE name and the name of the file that contains the objmod for the MODULE.

It is an error if modName is not a valid MODULE name, i.e., a valid MAINSAIL identifier. modName is the actual name of the MODULE, not a dummy name as established by setModName. If fileName is the null STRING, any association for modName is removed; otherwise, fileName specifies the name of a file containing the executable form of the MODULE, and must be a valid host system file name. The file must contain only a single MODULE; it cannot be a MODULE library.

setFileName provides the ability to override the default name of a file in which the objmod is assumed to reside. In addition, it can use the full syntax of host file names, rather than just the syntax of MODULE names, and thus can specify characteristics such as the directory on which the file resides.

Example 47–21. Use of setFileName
MODULE m (PROCEDURE p);
...
setFileName("m",
    
IF someCondition THEN "file1ELSE "file2");
p; # Call PROCEDURE p in MODULE m

Assuming the call to p causes m to be bound, m's objmod is obtained from file1 if someCondition is TRUE, otherwise from file2.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 47.18