Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command or function to force cdx file update
Message
From
02/03/2004 05:47:59
 
 
To
02/03/2004 03:04:39
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00882264
Message ID:
00882281
Views:
18
It is incredible, but the answer is NO !

The only way is:
Close the ALL the workareas that use the table on ALL datasessions
CD SYS(2023)
CLEAR
CURSORSETPROP("Buffering",1,0)
FOR nRec=10 TO 100000 STEP 0
	?
	? "N REC :",M.nRec
	CREATE TABLE testtable FREE ( F1 I ,F2 C(10) )
	FOR K=1 TO M.nRec
	  INSERT INTO (ALIAS()) VALUES (RECCOUNT(),STR(RECCOUNT()))
	NEXT
	INDEX ON F1 		TAG TAG1
	INDEX ON F2 		TAG TAG2
	USE

	ADIR(aFile,"testtable.cdx")
	? "index size",afile[1,2]
	USE testtable EXCLUSIVE
	REINDEX
	ADIR(aFile,"testtable.cdx")
	? "reindex size",afile[1,2]
	FLUSH
	SYS(1104)
	ADIR(aFile,"testtable.cdx")
	? "after flush and purge",afile[1,2]
	USE
	ADIR(aFile,"testtable.cdx")
	? "close size",afile[1,2]
	USE testtable share IN 10
	USE testtable share AGAIN IN 20
	ADIR(aFile,"testtable.cdx")
	? "before append",afile[1,2]
	SELECT 10
	FOR K=1 TO M.nRec
	  INSERT INTO (ALIAS()) VALUES (RECCOUNT(),STR(RECCOUNT()))
	NEXT
	FLUSH
	SYS(1104)
	ADIR(aFile,"testtable.cdx")
	? "after append",afile[1,2]
	USE IN 10
	FLUSH
	SYS(1104)	
	ADIR(aFile,"testtable.cdx")
	? "after close workarea",afile[1,2]
	USE IN 20
	ADIR(aFile,"testtable.cdx")
	? "after close dbf",afile[1,2]
	DROP TABLE testtable
	nRec=M.nRec*10
ENDFOR
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform