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 - arecsize() returns the record size for an alias http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 arecsize()          Returns the record size for an alias
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func uint arecsize extern
   param alias sDatabase

 Arguments
   sDatabase is the alias to retrieve information about.

 Return
   Total size of a record (including the one-byte deleted flag) in bytes.

 Description
   The arecsize() function returns the size of a record in the specified
   alias.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   // Program prints record size of any database
   
   dbfdef sTemp static // no field declarations are required
   enddef
   
   proc Test_arecsize
   vardef
      char cDbf
   enddef
   cDbf := alltrim( argv( 1 ) )
   if exist( cDbf )
      open cDbf alias sTemp
      ? cDbf
      ? "Record size is", istr( arecsize( sTemp ) ), "bytes"
      // calculate number of records that can be added
      // to the database before the disk is full
      ? istr( diskfree( 0 ) / arecsize( sTemp ) ), "more records fit on disk"
   else
      ? "Invoke this program with the name of an existing database"
   endif
   endproc

   proc main
   Test_arecsize()
   endproc

See Also: areccount() arecno() recsize()

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