home *** CD-ROM | disk | FTP | other *** search
- * Program..: NDX-SIZE.PRG
- * Author...: Tom Rettig & Luis A. Castro
- * Date.....: 8/7/83, 1/17/84, 6/24/84, 9/9/84
- * Notice...: Copyright 1983 & 1984, Ashton-Tate, All rights reserved
- * Version..: dBASE III, version 1.00; and dBASE II, versions 2.3x & 2.4x.
- * Notes....: Calculates the approximate size of index files for
- * the version of dBASE in which it is running.
- *
- * Newly created index files will usually be close
- * to the largest size calculated by this algorithm.
- *
- SET TALK OFF
- ?
- ?
- DO WHILE 1 = 1
- ACCEPT "Enter total width of <key expression> --> " TO string
- STORE VAL(string) TO width
- DO CASE
- CASE width < 1
- SET TALK ON
- RETURN
- CASE width > 100
- ? "Total width cannot exceed 100 characters -- try again."
- LOOP
- ENDCASE
- ACCEPT "Enter total number of records in file --> " TO string
- STORE VAL(string) TO records
- *
- * ---Branch for version of dBASE, and calculate the minimum size.
- IF TYPE('0') = 'C'
- * ---dBASE II.
- STORE INT( records / INT( 509/(width+4) ) +1 ) * 512 TO indexsize
- ELSE
- * ---dBASE III.
- STORE INT( records / INT( 509/(width+8) ) +1 ) * 512 TO indexsize
- ENDIF
- *
- * ---Print the results.
- ? "Smallest approximate size will be:", indexsize*1, "BYTES."
- ? " Largest approximate size will be:", indexsize*2, "BYTES."
- ?
- ENDDO
- * EOF: Ndx-size.prg
-
-