Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - ndxsize(<n key size>, <n number of records>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NDXSIZE(<N key size>, <N number of records>)
 Evaluates the potential maximum size of a dBASE III PLUS index file.
 Returns <expN> maximum size in bytes of index file from INDEX ON <key>.

 <key size> is 8 if the key is <expD> or <expN>.
 <key size> is LEN( <key> ) if the key is <expC>.
 <number of records> are the total records in the database file.

 Useful in learning whether there is enough available disk
 space to hold an index file before actually creating it.

 NDXSIZE() returns the size of an .NDX file created with
 dBASE III PLUS.  The size of an .NDX file created by linking
 in Clipper's NDX.OBJ file may vary from this formula.

 NTXSIZE() reports the maximum potential size under any
 circumstances, and NDXSIZE() reports the maximum potential
 size under INDEX ON.  If you are using NTXSIZE() to compute
 INDEX ON results, subtract 25% from the total.  Likewise, if
 you are using NDXSIZE() to compute results from APPEND with an
 open index, add 50% to the total.

 * Assumes open database file keyed on Last_name
 IF NDXSIZE( LEN(Last_name), LASTREC() ) < DISKSPACE()
    INDEX ON Last_name TO Lname
 ELSE
    ? "Error -- not enough disk space to create index."
 ENDIF


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: NTXSIZE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson