Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - fclose() close an open text file http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fclose()            Close an open text file
------------------------------------------------------------------------------
 Declaration
   fileio.hdr

 Syntax
   proc fclose extern
   param file fStream

 Arguments
   fStream is the file stream to manipulate.

 Return
   None.

 Description
   The fclose() procedure closes the text file associated with fStream.
   All buffers are flushed to the file before closing.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_fclose
   vardef
      file fTemp
      char cLine
   enddef
   if fopen( fTemp, "c:\autoexec.bat", F_READ, F_TEXT ) // open file
      do while .not. feof( fTemp )                      // to end of file
         fgetln( fTemp, cLine )                         // read a line
         ? cLine                                        // display line
      enddo
      fclose( fTemp )                                   // close file
   endif
   endproc

   proc main
   Test_fclose()
   endproc

See Also: fopen()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson