Descending Function | |
Returns a logical value that indicates whether an index tag was created with the Descending keyword
or whether the Descending keyword was included in Use, Set Index, or Set Order.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION Descending(
uIndex,
uArea
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual Descending(
Usual uIndex = default,
Usual uArea = default
)
Request Example
View SourceParameters
- uIndex (Optional)
- Type: Usual
Specifies the name or index number of a compound index file with CDXFileName.
The compound index file you specify can be the structural compound index file automatically opened with the table or an independent compound index file.
Specifies which index tag or index file Descending( ) tests.
nIndexNumber is typically an integer that starts at 1 and is increased by 1 to return additional values for each index tag.
If nIndexNumber is 1, a value for the master single-entry .idx index file or master index tag (if one is present) is returned.
As nIndexNumber increases, values for each tag in the structural compound index (if one is present) are returned.
The values are returned for the tags in the order in which the tags were created in the structural compound index.
After values for all the tags in the structural compound index are returned, values for each tag in any open independent compound indexes are then returned.
The values are returned from the tags in the order in which the tags are created in the independent compound indexes.
The empty string is returned if nIndexNumber is greater than the total number of open,
single-entry .idx files and structural compound and independent compound index tags.
- uArea (Optional)
- Type: Usual
Returns values for index files or tags open in a work area other than the current work area. This specifies the work area number or table alias.
If no table has the alias you specify, X# generates an error message.
Return Value
Type:
Usual
Logical
Remarks
You can order records in a table in descending order in two ways:
Descending( ) can determine if an index tag was created in descending order. Descending( ) returns true (.T.)
if the index tag you specify was created with the Descending keyword.
Descending( ) can also determine if the master index tag or master index file is in descending order. Descending( ) returns true (.T.)
if the Descending keyword was included in Use, Set Index, or Set Order for the master index tag or a single-entry index (.idx) file you specify.
If you don't include any of the optional arguments, Descending( ) returns a value for the master index tag or master index file.
If you don't include any of the optional arguments and a master index tag or .idx file isn't in effect
(for example, you've issued Set Order TO to place the table in physical record order), Descending( ) returns false (.F.).
Examples 1Close Databases
2Open Database (HOME(2) + 'Data\testdata')
3Use Customer
4Clear
5For nCount = 1 TO TAGCOUNT( )
6IF !EMPTY(TAG(nCount))
7? TAG(nCount) + ' Descending? '
8?? Descending(nCount)
9ELSE
10EXIT
11ENDIF
12ENDFor
See Also