INDICES()

Top  Previous  Next

 

The INDICES() function returns information about alternate key indices.

 

 

Format

 

INDICES(file.var)        To retrieve a list of indices

INDICES(file.var, index.name)        To retrieve information for a specific index

 

where

 

file.varis the file variable associated with an open file.

 

index.nameis the name of the index to be examined.

 

 

The first form of the INDICES() function returns a field mark delimited list of alternate key index names for the file referenced via file.var.

 

The second form of the INDICES() function returns a dynamic array resembling a dictionary record for the index named by the index.name argument. This dynamic array corresponds to the original dictionary record used to create the index except that field 1 is extended to include additional flags as a multivalued list.

 

Value 1

Index type (D, I, A, S or C)

Value 2

Set to 1 if the index needs to be built, otherwise null

Value 3

Set to 1 if the index is null-suppressed by use of the NO.NULLS option to CREATE.INDEX, otherwise null

Value 4

Set to 1 if updates are enabled, otherwise null

Value 5

Internal AK numbers

Value 6

The key sort mode within each index entry (L or R), null for indices created prior to release 2.2-16.

 

 

Example

 

INDEX.NAMES = INDICES(FVAR)

NUM.INDICES = DCOUNT(INDEX.NAMES, @FM)

FOR I = 1 TO NUM.INDICES

  NAME = INDEX.NAMES<I>

  CRT NAME : '   Type ' : INDICES(FVAR, NAME)[1,1]

NEXT I

 

The above program displays a list of alternate key index names and their type.