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 Pack Data Files

Program Source Code

Utility to Pack Data Files

by  ramani  Posted    (Edited  )
**********************************************
** Purpose ... Pack ALL Tables in a directory
** Author .... Subramanian.G
** HowRun..... DO myPack WITH "myDataDir"
** .....OR.... = myPack("myDataDir")
*********************************************
** Save this code as "myPack.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))
PACK
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