Difference between revisions of "FGETS()"
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) (→Class) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
Revision as of 15:13, 27 October 2009
Purpose
Function to read and return a line of text from an ASCII file
Syntax
FGETS(<expN1>[,<expN2>][,<expC>])
See Also
FCLOSE(), FCREATE(), FEOF(), FERROR(), FFLUSH(), FOPEN(), FPUTS(), FREAD(), FREADSTR(), FSEEK(), FWRITE()
Description
The FGETS() function reads and returns a line of text from the file specified by <expN>, an ASCII file handle. The file handle is returned from the FCREATE() or FOPEN() functions. The FGETS() function reads a line of text from the current position of the record pointer. You may optionally specify the number of bytes to read from that point with the numeric expression <expN2>. The number of bytes may be from 0 to 254. If a number is not specified, the FGETS() function will read 254 bytes or to the end line marker. The optional character expression <expC> defines an end of line terminator to determine where the FGETS() function will stop reading. The character expression <expC> must evaluate to one or two characters.
Example
fp = fopen("names.txt") count = 0 do while not feof() if fgets(fp,20) = "Smith" ++count endif enddo
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer