在下例中,使用 isexclusive( ) 函数检验表是否以独占方式打开。由于当前工作区中的表不是以独占方式打开,所以表没有被重索引。
cexclusive = set('exclusive')
set exclusive off
set path to (sys(2004) + 'samples\data\')
open data testdata && 打开一个测试数据库
use customer && 不以独占方式打开 customer 表
use employee in 0 exclusive && 在另一个工作区中以独占方式打开 employee
if isexclusive( )
reindex && 只有当表以独占方式打开时,才重建索引
else
wait window 'the table has to be exclusively opened'
endif
set exclusive &cexclusive