Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Utility to Reindex Tables with CDX Index

Program Source Code

Utility to Reindex Tables with CDX Index

by  ramani  Posted    (Edited  )
**********************************************
** Purpose ... ReIndex Tables in a directory
** Author .... Subramanian.G
** HowRun..... DO myReIndex WITH "myDataDir"
** .....OR.... = ReIndex("myDataDir")
*********************************************
** Save this as "myReIndex.PRG"
PARAMETERS myDataDir
SET EXCLUSIVE ON
LOCAL aFiles, nCount, I
DIMENSION aFiles(1,1)
nCount = ADIR(aFiles,myDataDir+"\"+"*.DBF")
=ASORT(aFiles,1)
I=1
FOR I = 1 TO nCount
WAIT WINDOW "Reindexing "+aFiles(I,1)+ ;
" ... Please wait" NOWAIT
SELECT 0
USE myDataDir+"\"+(aFiles(I,1))
REINDEX
USE
WAIT CLEAR
ENDFOR
SET EXCLUSIVE OFF
RETURN
*********************************************
** EOF
*********************************************
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top