xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET DESCENDING

Changes the descending flag of the controlling index at runtime.

Syntax

SET DESCENDING on | OFF | (<lOnOff>)

Arguments

on | OFF | (<lOnOff>)
This option toggles the descending flag of the controlling order in the current work area. The initial value of this setting is identical with the vlaue of the descending flag upon index creation. The value ON or .T. (true) enables the descending order, the value OFF or .F. (false) disables it. Note that when specifiying <lOnOff> as a logical expression, it must be enclosed in parentheses.

Description

The SET DESCENDING command is an equivalent to function OrdDescend(). It allows to change, or reverse, the ascending/descending order for navigating the record pointer of an indexed database.

Note that SET DESCENDING is only effective during runtime of an application. It does not change the DESCENDING flag in the file header of an index file. This flag can only be set with the INDEX command upon index creation.

Info

See also:INDEX, OrdCondSet(), OrdDescend()
Category: Index commands , SET commands
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates the effect of SET DESCENDING at runtime

   PROCEDURE Main
      USE Customer                     // create an ascending index
      INDEX ON Upper(LastName) TO Cust01

      GO TOP                           // go to first logical record
      ? Recno(), Lastname              // result:  28 Abbey

      SET DESCENDING ON                // change to descending order

      GO TOP                           // go to first logical record
      ? Recno(), Lastname              // result: 131 Zwillick

      CLOSE Customer
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe