You must be logged in to do that.

FileSeekLine

FileSeekLine
void FileSeekLine(int file, int linenum)

Documentation

Pass a handle to a file open in read mode, and it will set the current position in the file to the byte after the (linenum) new line is passed. Passing 0 sets the position to the start of the file.

Currently, lines are limited to 256 bytes. Attempting to use FileSeekLine with lines longer than this limit will cause it to position in the middle of lines and produce unexpected results.

Example Usage

int file = FileOpen("readme.txt", FILE_READ);
FileSeekLine(file, 12);
Log(FileReadLn(file));
FileClose(file);
// For the current verge readme this logs:
// "http://www.verge-rpg.com/docs/"
// Which is line number 13 as count starts at 0
Talkback

Post a new comment?

Talkback #2 written by Zip on 2004-06-23.

Does not work on files in write mode. Vec only knows why (actually, he gave pretty good reasons). Zip

Talkback #1 written by Gayo on 2004-06-11.

The first line of the file is 0 (not 1).

Post a new comment?

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.