home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
trl14db.zip
/
TRLPRG.EXE
/
NTXSIZE.PRG
< prev
next >
Wrap
Text File
|
1990-10-22
|
854b
|
30 lines
*********
* NTXSIZE.PRG
*
* by Tom Rettig and Leonard Zerman
*
* Placed in the Public Domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: NTXSIZE( <key length>, <expN> )
* Return: <expN> integer maximum potential number of bytes in index file
*********
PARAMETERS keylen, last_recno
IF last_recno = 0
tr_retn = 2048 && size of empty ntx file, any key size
ELSE
tr_retn = INT((last_recno/INT(((1020/(keylen + 10))-1)/2))+1) * 1024
ENDIF
IF fox
RETURN (tr_retn)
ENDIF
* return statement is based on this algorithm:
* maxitem = 1020 / (keylen+10) && max items per node
* minkeys = int( (maxitem-1) / 2 ) && min keys per node
* knodes = int( last_recno / minkeys ) && kbytes of nodes
* return (knodes+1) * 1024 && add one for the header
* eofunc ntxsize *