
finput - reading-in of MuPAD expressions from a file

Calling sequence:
finput(integer [ , identifier ... ])
finput(string [ , identifier ... ])

Parameter:
integer      --  positive integer
identifier   --  identifier
string       --  character string

Summary:

finput reads-in expressions from a file. The first argument specifies the file.
The other parameters of finput must be identifiers. The expressions are read
from the file in their sequence and assigned to these identifiers without being
evaluated. When called, the identifiers are also not evaluated. The result of
finput is the final read expression.

If one of the expressions cannot be read then its corresponding identifier and
all those following are assigned no values.  In this case the return value of
finput has the type DOM_NULL    .

If finput is called without identifiers as arguments then only one expression

is read. This is then the return value of the function. If the expression cannot
be read then the return value has the type DOM_NULL.

An expression read from a text file can be more than one line long.  It is
only finished when the expression is syntactically complete.  Additionally,
the expression must be closed with either a semi-colon or a colon.

The file is specified as follows:

  o  If a positive integer integer is given as the first argument then this
     is considered the file descriptor.  The corresponding file must have
     previously been opened with fopen .

     After the data have been read the file remains open. When next reading
     from the file with this descriptor, reading begins at the current position.

  o  If a character string is given with the argument string then the file
     with this name is opened. The file can be a text or a binary file. It is
     searched for in the current directory.

     The data are read starting at the beginning of the file. After the data
     have been read, the file is closed.

  o  In MacMuPAD, if an empty character string is given in the argument
     string then a dialog is opened in which the user can choose a file.

When a file name is given only those data can be read that are at the
beginning of a file. If data are to be read subsequently from a file through
several calls of finput then a file descriptor must be used.

In contrast to most other functions, arguments which are expression sequences,
are not flattened. finput is a kernel function.

>>  fprint("test", 1, 2, 3, 4):
    finput("test", d1, d2): d1, d2;

      1, 2

>>  fp:=fopen("test"): finput(fp, d1, d2):
    finput(fp, d1, d2): d1, d2;

      3, 4

See also:  fclose , fopen , fread , ftextinput , input , read

