Next: , Previous: , Up: Statements   [Contents][Index]

7.17 Command File Inclusion

If you have a file with a number of LUX statements in it, then you can execute those statements as if you typed them at the keyboard by including the file as follows:


If the filename file has no extension (i.e., no period in it), then .lux is added to it. If the file with the extension is not found, then the file without the extension is tried.

A special form of file inclusion is selected by typing two at-signs @ instead of one:


This restricted file inclusion works just like ordinary file inclusion, except that any subroutine, function, and blockroutine definitions that are present in the file are not performed. If the concerned routine was already defined, then this previous definition is retained. If the concerned routine does not yet exist, then the name of the routine, the file, and the position of the definition in the file are remembered. If the routine is called later on, then its definition is read from the file and performed at that time. This restricted file inclusion prevents unnecessary repeated definition of a routine. If you do want to change the definition of an already defined routine, then use ordinary file inclusion.