use. Linking modules

^use[file]

Operator
use allows using a module from specified file. If path begins with symbol "/", it will be regarded as path from Web-space root. In any other case, Parser will look for the module by relative path first and then if nothing was found in directories specified in variable $CLASS_PATH in Configuration method.

Note: before version 3.4.1 Parser did not look for the module by relative path from the file with the processed @USE/^use[] instruction.

The following construction can be used to link modules, too:
@USE
filename 1
filename 2



The difference between these constructions lies in that
@USE loads a module before a code is executed, while operator use can be called right from the script's body.
For example:

^if(condition){
   ^use[module1]
}{
   ^use[module2]
}


Note: attempts to use a module which were already used would not cause reread of that module.

We do recommend that you save the results of code's work by linking necessary modules with operator
use within the code of operator cache.


Copyright © 1997–2011 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 02.03.2011