xHarbour Reference Documentation > Function Reference |
Reads the current line and without moving the record pointer.
HB_FreadLN() --> cCurrentLine
The function returns the current line in the currently selected text file as a character string.
HB_FreadLN() reads the current line in the currently selected text file and leaves the record pointer unchanged. The current line is the posrtion of the text file beginning at the file pointer position up to the next Carriage return, Line feed pair.
Use function HB_FSkip() to advance the record pointer to the next line.
See also: | FOpen(), FSeek(), HB_FReadAndSkip(), HB_FReadLine(), HB_FSkip(), HB_FSelect(), HB_FUse() |
Category: | File functions , Text file functions , xHarbour extensions |
Source: | misc\hb_f.c |
LIB: | libmisc.lib |
// The example fills an array with the lines of a text file, // by skipping through the entire file. PROCEDURE Main LOCAL aLines := {} LOCAL cFile := "Textfile.txt" LOCAL nFile nFile := HB_FUse( cFile ) DO WHILE .NOT. HB_FEof() AAdd( aLines, HB_FReadLN() ) HB_FSkip(1) ENDDO HB_FUse() AEval( aLines, {|cLine| QOut( cLine ) } ) RETURN
http://www.xHarbour.com