focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / fgetfield
1 NAME
2     fgetfield - read the next word from a file
3
4 SYNOPSIS
5     fgetfield(fs)
6
7 TYPES
8     fs          file stream open for reading
9
10     return      string, null or error value
11
12 DESCRIPTION
13     If characters cannot be read from the file, an error value is returned.
14
15     Otherwise starting at the current file position, any whitespace
16     characters are skipped.  If the reading reaches end-of-file, the
17     null value is returned.  If non-whitespace is encountered, formation
18     of a string begins, continuing until whitespace of '\0' or end-of-file
19     is reached.  The returned value is this string (terminated as usual
20     by a null character).  After the operation, the file position will
21     be immediately after the first whitespace character of '\0' or at
22     end-of-file.
23
24 EXAMPLE
25
26     > f = fopen("/tmp/junk", "w")
27     > fputs(f, " Alpha Beta \n")
28     > freopen(f, "r")
29     > fgetfield(f)
30         "Alpha"
31     > fgetfield(f)
32         "Beta"
33     > fgetfield(f)
34     >
35     > freopen(f, "w")
36     > fputstr(f, " Alpha  ", "Beta")
37     > freopen(f, "r")
38     > fgetfield(f)
39         "Alpha"
40     > fgetfield(f)
41         ""
42     > fgetfield(f)
43         "Beta"
44
45 LIMITS
46     none - XXX - is this correct?
47
48 LINK LIBRARY
49     none - XXX - is this correct?
50
51 SEE ALSO
52     fgetstr, fputstr, fgets, fputs, fopen, files, fprintf
53