| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines the number of indexes open in a work area.
OrdCount( [<cIndexFile>] ) --> nOpenIndexes
The function returns the number of open indexes stored in <cIndexFile>. If this parameter is omitted, the return value is the total number of indexes open in a work area.
The function delivers information about the number of indexes open in a work area, or indexes stored in a particular index file. It can be used as loop counter limit when information about all open indexes is collected.
| See also: | DbOrderInfo(), OrdCreate(), OrdKey(), OrdNumber() |
| Category: | Index functions , Database functions , xHarbour extensions |
| Source: | rdd\dbcmd.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example shows a user defined function which collects information
// about open indexes in all work areas.
FUNCTION AllOrders()
LOCAL nArea := Select()
LOCAL aWorkArea := {}
LOCAL aOrders := {}
LOCAL i, imax, j, jmax
SELECT 0
imax := Select() - 1
FOR i:=1 TO imax
DbSelectArea( i )
jmax := OrdCount()
aOrders := Array( jmax )
AAdd( aWorkArea, { Alias(), aOrders } )
FOR j:=1 TO jmax
aOrders[j] := { OrdBagName(j), OrdName(j) , ;
OrdKey(j) , OrdCustom(j) }
NEXT
NEXT
DbSelectArea( nArea )
RETURN aWorkArea
http://www.xHarbour.com