focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / fscan
1 NAME
2    fscan - scan a file for possible assignment to variables
3
4 SYNOPSIS
5    fscan(fs, x_1, x_2, ..., x_n)
6
7 TYPES
8     fs                  file stream open for reading
9     x_1, x_2, ...       any
10
11     return              integer
12
13 DESCRIPTION
14    Starting at the current position on fs and while values remain in the
15    x_i arguments, fields of non-whitespace characters are read and evaluated
16    in succession and if the corresponding x_i is an lvalue, the value of
17    the field is assigned to x_i.  Scanning ceases when no x_i remain or
18    when the stream reaches end-of-file.
19
20    The function returns the number of fields evaluated.
21
22 EXAMPLE
23     > global a, b, c, d;
24     > f = fopen("/tmp/junk", "w+");
25     > fputs(f, "\t3+4\t\ta-2i  d=a^2   'word'")
26     > rewind(f)
27     > fscan(f, a, b, , c)
28         4
29     > print a, b, c, d
30     7 a-2i word 49
31
32 LIMITS
33     none - XXX - is this correct?
34
35 LINK LIBRARY
36     none - XXX - is this correct?
37
38 SEE ALSO
39     scan, strscan, fscanf, scanf, strscanf, printf, fprintf, strprintf
40