Function Descend() Foundation
Gives an inverted index key value for sorting in descending order.
Descend( <Expression> [,<lCompatible>] ) --> DescendValue
Descend() returns a value of the same data type as <Expression> modified for a descending sort. The exception is that date values return a value of numeric type, not date type.
The conversion function Descend() transforms the passed value so that it is suitable for a descending sort. The function is generally used as part of an index expression when generating descending order indexes. When an index file contains Descend() in its index expression, search values must also be modified using Descend() prior to use in SEEK or DbSeek().
An index using Descend() can be replaced with the use of the option DESCENDING in the command INDEX if the database engine supports this option. In this case, DESCENDING becomes an attribute of the index file and the index is created in descending order. When this technique is used, the function Descend() does not need to be specified either in the index key or in later search values used with DbSeek() or SEEK. Additionally, this technique also offers speed advantages over the use of Descend().
The sorting order of character strings depends on the collation table, i.e. the Descend() function must recognize the current SET COLLATION setting to produce the same result as the DESCENDING option of the INDEX command. This behavior, however, is not Clipper compatible since SET COLLATION does not exist in Clipper. If index files are accessed concurrently by Xbase++ and Clipper applications that call Descend() in their index key, the function must be called with the second parameter set to .T. (true).
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.