Files
harbour-core/contrib/hbnf/tests/fttext.prg
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

46 lines
841 B
Plaintext

#require "hbnf"
#include "fileio.ch"
PROCEDURE Main( cFile )
hb_default( @cFile, __FILE__ )
// open a text file here
IF ft_FUse( cFile, FO_READ ) > 1
DO WHILE ! ft_FEof()
? "line " + Str( ft_FRecNo(), 2 ) + " " + ft_FReadLn()
ft_FSkip( 1 )
ENDDO
?
my_goto( 18 )
my_goto( 2 )
ft_FGoBot()
?
? "after ft_FGoBot() now in line # " + hb_ntos( ft_FRecNo() )
ft_FGoTop()
?
? "after ft_FGoTop() now in line # " + hb_ntos( ft_FRecNo() )
?
? "ft_FLastRe() = " + hb_ntos( ft_FLastRe() )
// close the file
ft_FUse()
ENDIF
RETURN
STATIC PROCEDURE my_goto( n_go )
ft_FGoto( n_go )
?
? "after ft_FGoto( " + hb_ntos( n_go ) + " )"
? "line " + hb_ntos( ft_FRecNo() ) + " is " + LTrim( ft_FReadLn() )
RETURN