You could calculate the DBF file size by multiplying the number of records with the size of each record, and adding the header size. But this can't be applied to FPT and CDX files.
I would recommend just using fsize() or adir(), and get the real file size on disk.
You will
never reach the limit for the number of records, without also reaching the limit for the number of bytes: you are limited to 1000 million records and 2000 million bytes (approximate numbers), and each record has at least 2 bytes.
So, you only have to worry about the size of the three files.
>Greetings,
>
>V.F.P. tables subject:
>
>Does anyone would like to share with us, a UDF to measure where we are positioned face to any table's limit ?
>
>I mean we have limits on: # of records, # of bytes, # of bytes for CDX, FPT..
>
>This is a subject that affect us all.. And, I was wondering something as:
>
>
>lnNumber_of_regs_to_insert = lnNumber_to_process
>if my_rules_tier.limit_of_my_table("c:\folder\mytable.dbf", lnNumber_of_regs_to_insert) > 90
> * warn user
>endif
>* perform task
>
>
>TIA
>
>Claudio
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)