| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1032 人关注过本帖
标题:预览问题
只看楼主 加入收藏
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
结帖率:100%
收藏
 问题点数:0 回复次数:7 
预览问题
我在表单中设置一个预览按钮,用了以下代码,一运行表单,命令结果总是先在表单上显示,再看到预览结果,使得表单乱七八糟,有几位高手叫我设置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
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:0 
不好意思,有别人帮助你,我也就不说话了。其实,你去掉\\或\命令即可

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2008-02-20 13:32
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
收藏
得分:0 
如果去掉\\或\命令,所有的代码都不能用了,也达不到预览的结果
2008-02-20 15:19
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:0 
做报表啊

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2008-02-20 15:50
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
收藏
得分:0 
报表的结果是需要这段代码的。
2008-02-20 15:59
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:0 
若想把结果保存在 tm.txt 文本文件中,可以用 strtofile() 函数且能避免乱屏

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2008-02-20 16:02
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:0 
其实你的程序,好像用不着 tm.txt 和 da.txt 这两个文件。分别用两个变量 lcTM 和 lcDA 来代替这两个文件,后面的内容稍微修改一下也能完成你的任务。

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2008-02-20 16:28
TZTJ
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:737
专家分:115
注 册:2008-1-15
收藏
得分:0 
不好意思tiger ,这个问题在前几天hu9jj已经告诉我了,由于粗心,没有认真看好他的贴,今晚我再次看,原来用 SET TEXTMERGE NOSHOW  就可以了。
2008-02-20 22:39
快速回复:预览问题
数据加载中...
 
   



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

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