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 - fbclose() close a binary file http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fbclose()           Close a binary file
------------------------------------------------------------------------------
 Declaration
   fileio.hdr

 Syntax
   proc fbclose extern
   param value _HFILE hFile

 Arguments
   hFile is the handle of the file to manipulate.

 Return
   None.

 Description
   The fbclose() procedure closes a binary file associated with hFile. The
   handle must have been retrieved originally from the fbopen() function.

   You do not need to close the DOS predefined handles, STD_IN, STD_OUT,
   etc.. See fbread() for more details.

   If a Force application is terminated by the quit command, or by reaching
   the end of the main() procedure, open files are automatically closed
   before exiting to DOS.

   It is a good safety measure to keep files open only as long as necessary,
   so close files as soon as possible to make sure that file changes are
   physically written to the disk, and to free any allocated memory.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_fbclose
   vardef
      file fTemp
      char cLine
   enddef
   if fopen( fTemp, "c:\autoexec.bat", F_READ, F_TEXT ) // open file as text
      ? "Contents of autoexec.bat"
      ?
      do while .not. feof( fTemp )                      // display the file
         fgetln( fTemp, cLine )
         ? cLine
      enddo
      fclose( fTemp )                                   // close file
   endif
   endproc

   proc main
   Test_fbclose()
   endproc

See Also: fbopen()

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