erase 命令示例

在下面的示例中,把 customer.dbf 的结构和 country 字段等于“usa”的所有记录复制到 backup 表中,然后把 backup 表中的数据复制到打开的文本文件 temp 中。之后,在关闭 temp 文件的同时删除该文件。

close databases
open database (home( ) + 'samples\data\testdata')
use customer && 打开 customer 表

copy structure to backup
use backup
append from customer for country = 'usa'
copy to temp type delimited

wait window 'press esc to close and erase temp.txt' nowait
modify file temp.txt noedit
erase temp.txt
? iif(file('temp.txt'),'file not deleted','file deleted')
use
erase backup.dbf