How to Extract Tag Expressions from a .CDX File

ID: Q129630

The information in this article applies to:

SUMMARY

CDX tag expressions can be extracted from the .CDX file by using the command SYS(14) in a procedure. Extracting the tag expressions can be useful for recreating .CDX files or for documenting what the index tag is set to.

MORE INFORMATION

Open a table that has many tags created. Then run the following code sample. You will see that the array holds the name of the tag in the first column and the index expression in the second column. Also note that the array is redimensioned at the end of the program to have the same number of rows as there are tags in the .CDX file.

Code Sample

DIMENSION tags[255,2]      && Create a two dimensional array.
FOR t = 1 to 255
   IF '' <> tag[t]         && Test to see if there are more tags.
      tags[t,1]=tag[t]     && Assign tag name to first column.
      tags[t,2]=SYS(14,t)  && Assign tag expression to second column.
   ELSE
      EXIT                 && Break out of the loop.
   ENDIF
ENDFOR
DIMENSION tags[t-1,2]      && Redimension the array to save memory.
DISPLAY MEMORY LIKE tags   && Cause the array contents to be echoed to
                           && the screen.

Additional reference words: FoxWin 2.60a KBCategory: kbprg kbcode KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995