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 - ntxsize(<n key size>, <n number of records>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NTXSIZE(<N key size>, <N number of records>)
 Evaluates the potential maximum size of a Clipper index file.
 Returns <expN> maximum bytes in index file from any creation method.

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

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

 Index files on the same database and key can differ in size
 depending upon how they are created.  INDEX ON produces a
 smaller index than APPEND with an open index.

 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 NTXSIZE( 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: NDXSIZE()

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