Files
harbour-core/tests/fileio.prg
vszakats a4a357a18b 2013-03-15 11:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* /harbour/* -> /*
    * moved whole Harbour source tree one level up to
      avoid single 'harbour' top dir
2013-03-15 11:13:30 +01:00

35 lines
485 B
Plaintext

/*
* $Id$
*/
// Testing Harbour file io features
PROCEDURE Main()
LOCAL h
LOCAL cstr := " "
LOCAL ntmp := 1
h := FCreate( "test.txt" )
? "create handle", h
FWrite( h, "This test worked if you can see this" )
FClose( h )
h := FOpen( "test.txt" )
? "open handle", h
?
/* try to read what is there */
DO WHILE ntmp != 0
ntmp := FRead( h, @cstr, 1 )
IF ntmp > 0
?? cstr
ENDIF
ENDDO
?
FClose( h )
RETURN