*-- PackProj.prg * by Trey Walpole LParameters tcProject Local laFiles(1), lcCurDir, lcFile, lcProject, lnFileCnt Store "" To lcCurDir, lcFile, lcProject Store 0 To lnFileCnt *-- make sure a project was passed in... If Vartype(tcProject)#"C" MessageBox("Project name required.") Return EndIf lcProject = ForceExt(tcProject,"pjx") *... and that it exists If !File(lcProject) MessageBox("Project " + lcProject + " not found.") Return EndIf *-- switch to project's directory * to take advantage of the relative paths lcCurDir = FullPath(CurDir()) CD (JustPath(FullPath(lcProject))) *-- get all files from project of these types * V - VCX * K - SCX * R - FRX * M - MNX * d - DBC Select 0 Select name ; From (lcProject) ; Where type $ "VKRMd" ; And File(Chrtran(Alltrim(name),Chr(0),"")) ; Into Array laFiles lnFileCnt = _Tally Use && close up the PJX table *-- loop through and pack the files For ji = 1 To lnFileCnt lcFile = Chrtran(laFiles[ji],Chr(0),"") Wait Window "Packing: " + Chr(13) + lcFile Nowait Use (lcFile) Exclusive Pack Use EndFor *-- clean up Wait Clear CD (lcCurDir)