标题:预览问题
取消只看楼主
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
结帖率:100%
 问题点数:0 回复次数:3 
预览问题
我在表单中设置一个预览按钮,用了以下代码,一运行表单,命令结果总是先在表单上显示,再看到预览结果,使得表单乱七八糟,有几位高手叫我设置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
搜索更多相关主题的帖子: sele use set 表单 
2008-02-19 16:58
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
得分:0 
如果去掉\\或\命令,所有的代码都不能用了,也达不到预览的结果
2008-02-20 15:19
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
得分:0 
报表的结果是需要这段代码的。
2008-02-20 15:59
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
得分:0 
不好意思tiger ,这个问题在前几天hu9jj已经告诉我了,由于粗心,没有认真看好他的贴,今晚我再次看,原来用 SET TEXTMERGE NOSHOW  就可以了。
2008-02-20 22:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-200358-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.455827 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved