这是代码设置的需要,因为表中有通用型字段。我把全部代码上传,请你帮我分析解决以下。
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
*do form form1
labtitle=alltrim()
report form rptsj preview in screen
endif