>Thank you for answering George, the problem that I have is that some tables are free and some are not. I can't issue the FREE TABLE command for all of them because I am going to get error messages for the tables are that are already free. Below is the code is causing problems, I am trying to calculate the space required to do some data process.
>
>LOCAL nAllFilesSize
>nAllFilesSize = 0
>
>nFiles = ADIR(aFiles,"*.DBF")
>FOR a=1 TO nFiles
> USE (afiles(a,1))
> *---Get size of table header
> nTableHead = HEADER()
> *--- Calculate size of table
> nFileSize = nTableHead + (RECSIZE() * RECCOUNT() + 1)
> *--- Total Size for all files
> nAllFilesSize = nAllFilesSize + nFileSize
>ENDFOR
>
>IF DISKSPACE() < (nAllFilesSize * 3)
> MESSAGEBOX('Insufficient diskspace, process cannot be completed.',64,'System Message')
> CLOSE DATA ALL
> CANCEL
>ENDIF
>
If the database is current, INDBC() or ADBOBJECTS() could be used to determine if the table was a member of the database. Otherwise, you'd have to check the value of the table header via low level file functions to make this determination.
George
Ubi caritas et amor, deus ibi est