Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table header question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Table header question
Divers
Thread ID:
00945261
Message ID:
00945261
Vues:
67
Folks

In various discussions, e.g. at http://fox.wikis.com/wc.dll?Wiki~NotATable, and in the VFP help file, information is given regarding the structure of table headers.

I am led to understand that the file size for any table is calculated as (RECORDLENGTH * RECORDS) + HEADERSIZE. The position of the first data record is stored at byte offset 8-9 so that, since the header starts at byte zero, this is the same as the header size in bytes.

The thing is, when I actually do the above sum for my tables sometimes the answer is the same as and sometimes it is one byte less than the file size returned by FSEEK(lnHandle, 0, 2) when opening the table as a file for this purpose.

The formula for the actual number of records in a table is given in two versions in the Fox Wiki discussions:

lnCalculatedReccount = (lnFileSize-(lnFirstRecPos+1))/lnRecordSize
lnCalculatedReccount = FLOOR((lnFileSize-(lnFirstRecPos+1))/lnRecordSize)

I want to repair damage to my headers, so which answer is correct? Is FSEEK the best way to get the exact file size in bytes?

Thanks
John Burton
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform