预览问题
我在表单中设置一个预览按钮,用了以下代码,一运行表单,命令结果总是先在表单上显示,再看到预览结果,使得表单乱七八糟,有几位高手叫我设置set talk off或用noconsole,但都不能解决,tiger你怎么不发表你的意见呢?你的学问,你的为人,真使小人敬佩。set talk off
set order to tag
set safety off
sele 8
use sjtmp
sele 3
use tx
sele 4
use st
sele 5
use sjmc
sele 6
use sj
sele 7
use sjtx
if alltrim()==""
=messagebox("请选择试卷",0+64,"提示")
else
nxh=1
sele 7
locate for 试卷名称=alltrim()
do while (.not.eof())
ntx=题型编号
i=1
sele 3
locate for 题型编号=ntx
ctxmc=题型名称
*memotm=""
*memoda=""
set textmerge on
set textmerge delimiters to
set textmerge to tm.txt
store _text to gctmhandle &&保存tm.txt的句柄
store -1 to _text &&关闭对tm.txt文件的输出,但保持tm.txt文件的打开
set textmerge to da.txt &&创建并输出到da.txt
store _text to gcdahandle &&保存da.txt的句柄
sele 6
locate for 试卷名称=alltrim() .and. 题型编号=ntx
do while (.not.eof())
csth=alltrim(试题号)
sele 4
locate for 试题号=csth
tmtmp=""
datmp=""
*if (.not.eof())
tmtmp=题目
datmp=答案
*endif
sele 6
nfz=分值
*memotm=memotm+str(i)+". "+tmtmp
*memoda=memoda+str(i)+". "+datmp
store gctmhandle to _text
if i=1
\\<<alltrim(str(i))>>.
else
\
\<<alltrim(str(i))>>.
endif
\\<<tmtmp>>
store gcdahandle to _text
if i=1
\\<<alltrim(str(i))>>.
else
\
\<<alltrim(str(i))>>.
endif
\\ 答案:<<datmp>>
i=i+1
continue
enddo
fclose(gctmhandle)
fclose(gcdahandle)
sele 8
append blank
*set textmerge to
replace xh with nxh,题型名称 with ctxmc
*store gctmhandle to _text
append memo 题目 from tm.txt overwrite
*store gcdahandle to _text
append memo 答案 from da.txt overwrite
erase tm.txt
erase da.txt
nxh=nxh+1
sele 7
continue
enddo
endif
*do form form1
labtitle=alltrim()
report form rptsj preview NOCONSOLE