How to Extract Tag Expressions from a .CDX File

Last reviewed: June 27, 1995
Article ID: Q129630
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.