xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_FRecno()

Returns the current line number of the currently selected text file.

Syntax

HB_FRecno() --> nLineNumber

Return

The function returns the position of the record pointer (line number) of the currently selected text file as a numeric value.

Info

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

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe