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 - dbcheck() determine if a file is a database http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 dbcheck()           Determine if a file is a database
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical dbcheck extern
   param const char cFileName

 Arguments
   cFileName is the name of the file to validate.

 Return
   A logical indicating if the file is a database.

 Description
   The dbcheck() function determines if a file is a database, conforming
   the structural requirements of a standard .dbf file.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   // Application to check if a file is a database
   
   proc Test_dbcheck
   vardef
      char    cFile
      logical lDbf
   enddef
   cFile := argv( 1 )
   if .not. isempty( cFile )
      if exist( cFile )
         lDbf := dbcheck( cFile )
         if lDbf
            ? "File", cFile, "appears to be a database file"
         else
            ? "File", cFile, "does not appear to be a database file"
         endif
      else
         ? "File", cFile, "is not found"
      endif
   else
      ? "File name not supplied"
   endif
   endproc

   proc main
   Test_dbcheck()
   endproc

See Also: exist()

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