home *** CD-ROM | disk | FTP | other *** search
-
- Parameters DbfName,Ntx1,Ntx2,Ntx3,Ntx4,Ntx5,Ntx6,Ntx7,Ntx8,Ntx9,Ntx10
-
- If Type('Ntx1') = 'U'
- Ntx1 = DbfName
- EndIf
-
- If Type('DBFName') = 'U'
- Quit
- EndIf
-
- If ! '.' $ DBFName
- DBFName = DBFName + '.DBF'
- EndIf
-
- Use &DbfName.
- Clear
-
- ? 'Analyzing &DbfName.'
-
- ? 'Record Count = '
- ?? Ltrim(Str(RecCount()))
-
-
- From = Row()
-
- *****************************
- * Repeat for all open indices:
-
- For X = 1 To PCount() - 1
-
- @ From + 3, 0 Clear To 24, 79
- @ From + 3, 0
-
- Ntx = Str(X,1)
- Ntx = 'Ntx' + Ntx
- Ntx = &Ntx.
-
- If ! '.' $ Ntx
- Ntx = Ntx + '.NTX'
- EndIf
-
- Set Index To &Ntx.
- ? 'Current index = &Ntx.'
- ?
-
-
- Jazz = IndexKey(0)
-
- Jazz = If(Empty(Jazz),.T.,&Jazz.)
-
- ? 'Index Key = ' + If(Type('Jazz') $ 'NCD' , IndexKey(0) , 'ERROR')
-
- ? 'Length of Key = '
-
- Do Case
-
- Case Type('Jazz') = 'N'
- KeyLen = Len(Str(Jazz))
-
- Case Type('Jazz') = 'C'
- KeyLen = Len(Jazz)
-
- Case Type('Jazz') = 'D'
- KeyLen = 8
-
- Otherwise
- ?? 'Error in index key ' + Ltrim(Str(X))
- Wait
- Quit
-
- EndCase
-
- ?? Ltrim(Str(KeyLen))
-
- ? 'Size of index = '
- ?? Ltrim(Str(NtxSize(RecCount(),KeyLen))) + ' (Our Function)'
-
- ?
- ? 'DOS reports:'
- dir &Ntx.
- wait
-
- Next
- ********************************
-
-
- quit
-
-
- *----------------------------------------
- Function NtxSize
- Parameters Ntx_Recs,Ntx_KyLen
- Return Max(Int(((Ntx_Recs / Int(((1020/(Ntx_KyLen+10))-1)/2))+1) * 1024),Int(2048))
-