aLOCAL lnCounter, ; > loList, ; > lcTable, ; > lcSaveOnError > >PRIVATE pnError > >*-- First thing to do here will be to get a confirmation >*-- of what they have elected to do. > >IF !YesNo(TAKELONG_LOC + " " + AREYOUSURE_LOC) > RETURN >ENDIF > >loList = this.lstTables >pnError = 0 > >*-- A quick note here. pnError will have the number of an error that >*-- occurs. If an error occurs when trying to open a table exclusively, the >*-- ERROR() method will be called which will set the value of pnError. >*-- >*-- I am assuming that an error greater than 0 means that we have a multi user >*-- conflict... > >thisform.WaitMode(.T.) > >goApp.oMeta.SetDatabase(dbc()) > >FOR lnCounter = 1 TO loList.ListCount > IF loList.Selected(lnCounter) > lcTable = loList.List(lnCounter) > > SELECT (lcTable) > > IF !ISEXCLUSIVE(lcTable) > lcSaveOnError = ON('ERROR') > ON ERROR pnError = Error() > USE DBF(lcTable) EXCLUSIVE > ON ERROR &lcSaveOnError > ENDIF > > IF pnError > 0 > =MsgSvc('FileInUseNotManaged', ALLTRIM(lcTable)) > pnError = 0 > LOOP > ENDIF > > IF this.chkPack.Value = .T. > goApp.oMeta.oSDTMgr.Reindex(lcTable, .T.) > ELSE > IF this.chkPackMemo.Value = .T. > this.oTableBehavior.PackMemo() > ENDIF > > IF this.chkReindex.Value = .T. > goApp.oMeta.oSDTMgr.Reindex(lcTable) > ENDIF > ENDIF > > USE > ENDIF >ENDFOR