Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- Tables
Message
 
To
17/12/1999 16:24:19
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00305460
Message ID:
00305489
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform