Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function to return numeric position of record in index?
Message
 
À
01/04/2002 20:14:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00639744
Message ID:
00639984
Vues:
29
If I am not mistaken, the single-entry IDX file simply contains offsets into the data file. Simplistically, this means there's a look up table of some sort that says that the record having this particular value in the index is actually found at physical record number n. Or perhaps it contains an actual byte offset into the data file. This is, after all, what an index file is designed to accomplish: to "index" or order the data elements in a fashion other than their physical order.

Now, this is what the IDX file does, and a CDX file is merely a collection of IDX files, so therefore you have to determine which of the tags within the CDX is the one you want, and then locate the particular entry within that tag that points to the particular record in question.

It sounds a lot more complex than it is, but this is the functionality that is engaged when you perform the command
SET ORDER TO [SOMETAGNAME], or (even better example but VFP7 only)
INDEXSEEK("SOMEDATA","ALIASNAME","TAGNAME")

You merely want to open this mechanism to find what physical record it is pointing at. To do this, you probably have to close the indices, and perform a low-level open of the CDX file using perhaps the FOPEN() function. Then you will have to locate the appropriate piece of data using FREAD().

There used to be information detailing the internal structure of the IDX/CDX files somewhere. Does anyone know if it's still around?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform