home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / files / gets < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.3 KB  |  21 lines

  1.           gets fileId ?varName?
  2.                Reads the next line from the file given by  fileId  and
  3.                discards the terminating newline character.  If varName
  4.                is specified, then the line is placed in  the  variable
  5.                by  that  name  and  the return value is a count of the
  6.                number of characters read (not including the  newline).
  7.                If  the  end  of the file is reached before reading any
  8.                characters then -1 is returned and varName is set to an
  9.                empty  string.   If  varName  is not specified then the
  10.                return value  will  be  the  line  (minus  the  newline
  11.                character) or an empty string if the end of the file is
  12.                reached before reading any characters.  An empty string
  13.                will  also be returned if a line contains no characters
  14.                except the newline, so eof  may  have  to  be  used  to
  15.                determine  what really happened.  If the last character
  16.                in the file is  not  a  newline  character,  then  gets
  17.                behaves   as   if  there  were  an  additional  newline
  18.                character at the end of the file.  FileId must be stdin
  19.                or  the  return  value from a previous call to open; it
  20.                must refer to a file that was opened for reading.
  21.