| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the current line number of the currently selected text file.
HB_FRecno() --> nLineNumber
The function returns the position of the record pointer (line number) of the currently selected text file as a numeric value.
| See also: | FOpen(), FSeek(), HB_FLastRec(), HB_FGoto(), HB_FReadLN(), HB_FSkip(), HB_FSelect(), HB_FUse() |
| Category: | File functions , Text file functions , xHarbour extensions |
| Source: | misc\hb_f.c |
| LIB: | libmisc.lib |
// The example lists the lines of a text file along with
// their line numbers
PROCEDURE Main
LOCAL cFile := "HB_FRecno.prg"
nFile := HB_FUse( cFile )
DO WHILE .NOT. HB_FEof()
? "Line #" + LTrim( Str( HB_FRecno() ) ), HB_FReadLN()
HB_FSkip(1)
ENDDO
HB_FUse()
RETURN
http://www.xHarbour.com