Difference between revisions of "FREAD()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to read and return a line of text from an ASCII file | Function to read and return a line of text from an ASCII file | ||
− | |||
==Syntax== | ==Syntax== | ||
FREAD(<expN1>,<expN2>) | FREAD(<expN1>,<expN2>) | ||
− | |||
==See Also== | ==See Also== | ||
[[FCLOSE()]], [[FCREATE()]], [[FEOF()]], [[FERROR()]], [[FFLUSH()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREADSTR()]], [[FSEEK()]], [[FWRITE()]] | [[FCLOSE()]], [[FCREATE()]], [[FEOF()]], [[FERROR()]], [[FFLUSH()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREADSTR()]], [[FSEEK()]], [[FWRITE()]] | ||
− | |||
==Description== | ==Description== | ||
The FREAD() function reads and returns a line of text from the specified ASCII file. The ASCII file is specified by the file handle <expN1>. The file handle is created when the ASCII file is created with the FCREATE() function, or opened with the FOPEN() function. The FREAD() reads a line of text from the current position of the file pointer. You must specify the number of bytes to read from that position with the numeric expression <expN2>. The number of bytes may be from 0 to 254. | The FREAD() function reads and returns a line of text from the specified ASCII file. The ASCII file is specified by the file handle <expN1>. The file handle is created when the ASCII file is created with the FCREATE() function, or opened with the FOPEN() function. The FREAD() reads a line of text from the current position of the file pointer. You must specify the number of bytes to read from that position with the numeric expression <expN2>. The number of bytes may be from 0 to 254. | ||
− | |||
==Example== | ==Example== | ||
Line 23: | Line 19: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:ASCII File Access Functions]] | [[Category:ASCII File Access Functions]] |
Latest revision as of 08:21, 4 February 2013
Contents
Purpose
Function to read and return a line of text from an ASCII file
Syntax
FREAD(<expN1>,<expN2>)
See Also
FCLOSE(), FCREATE(), FEOF(), FERROR(), FFLUSH(), FGETS(), FOPEN(), FPUTS(), FREADSTR(), FSEEK(), FWRITE()
Description
The FREAD() function reads and returns a line of text from the specified ASCII file. The ASCII file is specified by the file handle <expN1>. The file handle is created when the ASCII file is created with the FCREATE() function, or opened with the FOPEN() function. The FREAD() reads a line of text from the current position of the file pointer. You must specify the number of bytes to read from that position with the numeric expression <expN2>. The number of bytes may be from 0 to 254.
Example
fp = fopen("names.txt") ?fread(fp,80) Smith,Bill fclose(fp)