Returns true (.T.) if a table or database is opened for exclusive use; otherwise, returns false (.F.).
ISEXCLUSIVE([cTableAlias | nWorkArea | cDatabaseName [, nType]])
- Specifies the alias of the table for which the exclusive use status is returned. Visual FoxPro generates an error message if you specify a table alias that doesn't exist.
- Specifies the work area of the table for which the exclusive use status is returned. ISEXCLUSIVE(В ) returns false (.F.) if a table isn't open in the work area you specify.
- Specifies the name of the database for which the exclusive use status is returned.
Specifies whether the exclusive status is returned for a table or a database. The following table lists the values for nType and the corresponding status returned.
To determine the exclusive status for a database, you must include nType with a value of 2.
nType Exclusive Status Returned
ISEXCLUSIVE(В ) returns a value for the table open in the currently selected work area if you omit the optional cTableAlias, nWorkArea, or cDatabaseName arguments.
A table is opened for exclusive use by including the EXCLUSIVE keyword in USE, or by setting SET EXCLUSIVE to ON before the table is opened.
A database is opened for exclusive use by including the EXCLUSIVE keyword in OPEN DATABASE.
In the following example, the ISEXCLUSIVE(В ) function verifies that the table was opened for exclusive use. The table is not reindexed since the one in the current work are was not opened for exclusive use.
cExclusive = SET('EXCLUSIVE') SET EXCLUSIVE OFF SET PATH TO (HOME(2) + 'data\') OPEN DATA testdata && Opens the test databsase USE customer && Not opened exclusively USE employee IN 0 EXCLUSIVE && Opened exclusively in another work area IF ISEXCLUSIVE( ) REINDEX && Can only be done if table opened exclusively ELSE WAIT WINDOW 'The table has to be exclusively opened' ENDIF SET EXCLUSIVE &cExclusive