xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

OrdListClear()

Closes all indexes open in a work area.

Syntax

OrdListClear() --> NIL

Return

The function always returns NIL.

Description

OrdListClear() closes all indexes open in a work area. When indexes are closed, database records can only be navigated in their physical order, since a logical order is no longer present.

Info

See also:DbClearIndex(), OrdListAdd(), OrdListRebuild()
Category: Database functions , Index functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example creates two indexes and demonstrates the effect of
// closing the indexes with OrdListClear()

   PROCEDURE Main
      USE Customer
      INDEX ON Upper( FirstName ) TO Cust01
      INDEX ON Upper( LastName  ) TO Cust02

      USE Customer
      ? Recno(), LastName, Firstname   // result:  1  Miller   Irene

      OrdListAdd( "Cust01" )

      ? OrdCount()                     // result:  1
      ? Recno(), LastName, Firstname   // result:  9  Feldman  Allen

      OrdListAdd( "Cust02" )
      OrdSetFocus( "Cust02" )
      DbGoTop()

      ? OrdCount()                     // result:  2
      ? Recno(), LastName, Firstname   // result: 20  Alberts  Cathy

      OrdListClear()
      ? OrdCount()                     // result:  0
      ? Recno(), LastName, Firstname   // result: 20  Alberts  Cathy

      USE
   RETURN

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