Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Function source

source fileName
source inputStream

Executes Tea code read from a file or from an input stream.

Parameters:
fileName - String representing the pathname of the file to execute.
inputStream - A TInput from where the Tea code will be read.
Returns:
The result of the last statement executed.

The Tea code contained in fileName is always executed. This is unlike the import function, where the file only gets executed the first time. The fileName argument is supposed to be the path name of a file containing Tea code. The path name can be either absolute or relative to the current working directory of the process.

The source function can also read Tea code from a TInput. In this case the inputStream is read until an end-of-file condition is reached. It is the caller responsability to close the inputStream

The code is executed in a context descending from the global context. That means variables defined locally in the code (using the define function) will only be known inside that code.

If the file or the input stream can not be read a runtime error will occur.


Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002