IDXCOLLATE( ) Function Example

The following example opens the customer table in the testdata database. FOR ... ENDFOR is used to create a loop in which IDXCOLLATE( ) is used to display the collation sequence of each index tag in the customer structural index. The name of each structural index tag is displayed with its collation sequence.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE Customer     && Open customer table
CLEAR

FOR nCount = 1 TO 254
   IF !EMPTY(TAG(nCount))  && Checks for tags in the index
   ? TAG(nCount) + ' '  && Display tag name
   ?? IDXCOLLATE(nCount)  && Display collation sequence
   ELSE
      EXIT  && Exit the loop when no more tags are found
   ENDIF
ENDFOR