Clear
gnDbfnumber = Adir(gatables, '*.DBf')
&& 创建一个数组
For nCount = 1 To gnDbfnumber
&& 遍历表
lcStr = Filetostr(gatables(nCount, 1))
* 4 - 7 --> Number of records in file
* Calculate the number of records (bytes 5,6,7 and 8)
nRecords = Asc(Substr(lcStr, 5, 1)) + Asc(Substr(lcStr, 6, 1))*256 + ;
Asc(Substr(lcStr, 7, 1))*256^2 + Asc(Substr(lcStr, 8, 1))*256^3
If nRecords > 0
? gatables(nCount, 1) + " 有记录数 : " + Transform(nRecords) + ",不要删除。"
Else
? gatables(nCount, 1) + " 无记录数 : " + Transform(nRecords) + ",已经删除!"
Delete File &gatables(nCount, 1)
&& 删除.dbf
Endif
Endfor