
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>fadvance() - advance to the next line of text in a file</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Name: fadvance() - advance to the next line of text in a file
Usage: <integer> = fadvance(<handle>,[<linelen>])
Params: integer <handle> from a previous fopen() or fcreate()
integer <linelen> - the maximum length of a line if no
newline character is encountered, optional - default
is 512 bytes
Returns: an integer equal to the starting position of the next
line or -1 if an error occurs. The file pointer is
moved to the first byte of the next line of text.
---------------------------------- Example ---------------------------------
handle = fopen("data.txt")
flocate(handle,"BEGIN:")
fadvance(handle)
datatext = freadline(handle,120)
Note: This example finds the keyword "BEGIN:" and then
advances to the next line to start reading in the data.
The fadvance() function will use the character specified
by the _newline() function as a line terminator.
See Also: freadline() fbol() frewind() flocate() _newline()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson