Click or drag to resize

Primary Function

X#
-- todo --
Returns true (.T.) if an index tag is a primary index tag; otherwise, returns false (.F.).

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION Primary(
	nIndexNumber,
	uArea
) AS LOGIC CLIPPER
Request Example View Source

Parameters

nIndexNumber (Optional)
Type: Usual
Specifies the number of the index tag for which Primary( ) returns the primary status. Primary( ) returns the primary status in the following order as nIndexNumber increases from 1 to the total number of structural compound and independent compound index tags.
Primary status for each tag in the structural compound index (if one is present) are returned first. The primary status is returned for the tags in the order the tags are created in the structural index.
Primary status for each tag in any open, independent compound indexes are returned next. The primary status is returned for the tags in the order in which the tags are created in the independent compound indexes.
If you omit nIndexNumber, Primary( ) checks the master controlling index tag to see if it's a primary index tag. If there is no master controlling index tag, Primary( ) returns false (.F.).
uArea (Optional)
Type: Usual
Specifies the work area of the index tag specified with nIndexNumber.
Or
Specifies the work area of the index tag specified with nIndexNumber.
If you omit uArea, Primary( ) checks the index tag in the currently selected work area to see if it's a primary index tag.

Return Value

Type: Logic
Logical
Examples
X#
 1Close Databases
 2Set PATH TO (HOME(2) + 'Data\')   // Sets path to database
 3Open Database testdata  // Open testdata database
 4Use Customer     // Open customer table
 5For nCount = 1 TO TAGCOUNT( )
 6IF !EMPTY(TAG(nCount))  // Checks for tags in the index
 7? TAG(nCount)  // Display tag name
 8? Primary(nCount)     // Display primary status
 9ELSE
10EXIT  // Exit the loop when no more tags are found
11ENDIF
12ENDFor
See Also