Code: Select all
#include "dbinfo.ch"
REQUEST HB_GT_WIN_DEFAULT // Console Output
proc main()
local i, n := int(2^22) + 10, nStep := int ( n / 50 )
SET DBFLOCKSCHEME TO DB_DBFLOCK_HB64
if !file("tst4GB.dbf")
? "Building tst4GB.dbf..., be patient ..."
? REPLICATE ( Chr ( 177 ), 50 )
DevPos( ROW(), COL()-50 )
// Note : Harbour 64 Bit can use Type C > 256 Length
dbcreate("tst4GB.dbf",{{"F1","C",1023,0}, {"id","+",4,0}})
use tst4GB exclusive
for i:=1 to n
dbappend()
replace F1 with str(i,10)
IF i%nStep = 0
?? Chr ( 219 )
endif
next i
close
?? " 100% done"
endif
use tst4GB shared alias tst1 new
use tst4GB shared alias tst2 new
? "records:", tst1->(lastrec()), ;
", size:", tst1->(header())+tst1->(lastrec())*tst1->(recsize())
? "tst1 goto:", lastrec()-1, tst1->(dbgoto(lastrec()-1))
? "tst1 recno():", tst1->(recno()), "->", alltrim(tst1->(fieldget(1))), "->" , tst1->(fieldget(2))
? "tst2 goto:", lastrec()-1, tst2->(dbgoto(lastrec()-1))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
? "FLOCK tst1: ", tst1->(flock())
n := int(2^20+10)
? "tst2 goto:", n-1, tst2->(dbgoto(n-1))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
? "tst2 goto:", n-2, tst2->(dbgoto(n-2))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
n := int(2^21+10)
? "tst2 goto:", n-1, tst2->(dbgoto(n-1))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
? "tst2 goto:", n-2, tst2->(dbgoto(n-2))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
n := lastrec()
? "tst2 goto:", n-1, tst2->(dbgoto(n-1))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
? "tst2 goto:", n-2, tst2->(dbgoto(n-2))
? "tst2 recno():", tst2->(recno()), "->", alltrim(tst2->(fieldget(1))), "->" , tst2->(fieldget(2))
close all
inkey ( 0 )
return