Click or drag to resize

IsExclusive Function

X#
-- todo --
Returns true (.T.) if a table or database is opened for exclusive use; otherwise, returns false (.F.).

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION IsExclusive(
	uArea,
	nType
) AS LOGIC CLIPPER
Request Example View Source

Parameters

uArea (Optional)
Type: Usual
Specifies the alias of the table for which the exclusive use status is returned. X# generates an error message if you specify a table alias that doesn't exist.
Or
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.
Or
Specifies the name of the database for which the exclusive use status is returned.
nType (Optional)
Type: Usual
Specifies whether the exclusive status is returned for a table or a database. The table in the remarks section 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.

Return Value

Type: Logic
Logical
Remarks
IsExclusive( ) returns a value for the table open in the currently selected work area if you omit the optional uArea, 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.
nTypeExclusive status returned
1Table
2Database
Examples
X#
 1cExclusive = Set('Exclusive')
 2Set Exclusive Off
 3Set Path To (Home(2) + 'data\')
 4Open Data testdata  // Opens the test databsase
 5Use customer     // Not opened exclusively
 6Use employee IN 0 Exclusive    // Opened exclusively in another work area
 7IF IsExclusive( )
 8REIndex  // Can only be done if table opened exclusively
 9ELSE
10WAIT 'The table has to be exclusively opened'
11ENDIF
12Set Exclusive &cExclusive
See Also