Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> isdbf() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    ISDBF()

Purpose:     Test if a file is a valid .DBF format database file.

Syntax:      ISDBF( filename [, showerror ] )

Arguments:   filename    - Character string or variable indicating the
                           name of the file to check if is a valid .DBF
                           format database file.

             showerror   - Optional logical value indicating whether or
                           not to display an error message if the file is
                           not a valid .DBF format file.  If omitted or a
                           non-logical value is given, the default is
                           False, do not display any error message.

Returns:     True if the file is a valid .DBF format file, false if not.

Description: ISDBF() is a file function used to test if a given file is a
             valid .DBF format file.  This is useful in situations where
             the format of a file cannot be assumed to be .DBF.

Notes:       If the required filename parameter is omitted, or is not a
             character type parameter, ISDBF() will return False and set
             RLIBERROR().

             The .DBF file format dictates that the first byte of the file
             be either 0x03 or 0x83 hexadecimal values (3 or 131 decimal),
             0x03 for regular .DBF files, 0x83 for .DBF files with one or
             more memo fields.

Example:     *-- verify a file is .DBF before trying to USE it
             IF ISDBF("myfile.dbf")
                USE myfile.dbf
             ELSE
                ? "Not a valid .DBF file."
             ENDIF

Source:      RL_ISDBF.PRG

See also:    DBFCREATE(), ISFIELD()

See Also: DBFCREATE() ISFIELD()

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