Skip to content

Declare_Datafile

See Also: Open

Purpose

To declare the definition of a database table available for use in programs.

Syntax

Declare_Datafile {tableName}

Where {tableName} is the DataFlex Name of a database table. {tableName} cannot contain a path; only a table name.

What It Does

Declare_Datafile includes the .FD for the named file and defines any related symbols (e.g., FILE.FILE_NUMBER). Declare_Datafile allows the file to be used in your program code before it is open.

Example

Declare_Datafile
    Customer

Object oMyObject is an cObject
    Procedure Close_File
        // Without Declare_Datafile, the next line would not compile.
        Close Customer
    End_Procedure

    Procedure Open_File
        Open Customer
    End_Procedure
End_Object

Notes

  • Declare_Datafile has no effect if used on an already-opened table.