JavaScript Editor js editor     Web development 



Main Page

Returns the name of a table open in a specified work area or a table name from a table alias.

DBF([cTableAlias | nWorkArea])

Parameters

cTableAlias


Specifies the table alias.
nWorkArea


Specifies the work area number. If you omit cTableAlias and nWorkArea, DBF(В ) returns the name of the table open in the current work area. DBF(В ) returns an empty string if a table isn't open in the work area you specify. If a table doesn't have the alias you specify with cTableAlias, Visual FoxPro generates an error message. For information on creating an alias for a table, see USE.

Return Value

Character

Remarks

When SET FULLPATH is ON, DBF(В ) returns the path to the table with the table name. When SET FULLPATH is OFF, DBF(В ) returns the drive on which the table resides with the table name.

Example

The following example returns the name of a table from its work area and its alias, and returns the empty string after all tables have been closed.

В Copy Code
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer IN 2 ALIAS mycust
CLEAR
? DBF(2)  && Displays customer.dbf with its path
? DBF('mycust')  && Displays customer.dbf with its path
CLOSE DATABASES
? DBF( )      && Displays the empty string

See Also



JavaScript Editor js editor     Web development