| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2960 人关注过本帖
标题:看下代码有问题吗?
取消只看楼主 加入收藏
l87233203
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2015-3-8
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
看下代码有问题吗?
我在程序里面加了下面的代码,就出现“操作符/操作数类型不匹配。”是哪里出错了????

S:是表的字段   数值型
A1 A2 B1 B2 C1 C2 D1 D2 E1 E2:是程序中的变量,他的值都是来自S的值。为数值型

X1 X2 X3 X4 X5 X:是程序中的变量    字符型

xjqs:::是表的字段,   数值型
图片附件: 游客没有浏览图片的权限,请 登录注册


不加下面的代码,就没事!!!!



DO CASE
   CASE x1=x
        DO CASE
           CASE m>0
                IF s<a2*0.895
                   INSERT INTO dmx(xjqs) VALUES (a2)
                ENDIF
               
           CASE m<0
                IF s<a1*0.895
                   INSERT INTO dmx(xjqs) VALUES (a1)
                ENDIF
               
        ENDCASE      
   CASE x2=x
        DO CASE
           CASE m>0
               
                IF s<b2*0.895
                   INSERT INTO dmx(xjqs) VALUES (b2)
                ENDIF
               
           CASE m<0
                IF s<b1*0.895
                   INSERT INTO dmx(xjqs) VALUES (b1)
                ENDIF
               
        ENDCASE
   CASE x3=x
        DO CASE
           CASE m>0
                IF s<c2*0.895
                   INSERT INTO dmx(xjqs) VALUES (c2)
                ENDIF
               
           CASE m<0
                IF s<c1*0.895               
                   INSERT INTO dmx(xjqs) VALUES (c1)
                ENDIF
               
        ENDCASE
   CASE x4=x
        DO CASE
           CASE m>0
                IF s<d2*0.895
                   INSERT INTO dmx(xjqs) VALUES (d2)
                ENDIF
               
           CASE m<0
                IF s<d1*0.895
                   INSERT INTO dmx(xjqs) VALUES (d1)
                ENDIF
               
        ENDCASE
   CASE x5=x
        DO CASE
           CASE m>0
                IF s<e2*0.895
                   INSERT INTO dmx(xjqs) VALUES (e2)
                ENDIF
               
           CASE m<0
                IF s<e1*0.895
                   INSERT INTO dmx(xjqs) VALUES (e1)
                ENDIF
               
        ENDCASE  
ENDCASE


图片附件: 游客没有浏览图片的权限,请 登录注册


是在编写好的EXE软件里面,出错的。在VFP中连编EXE软件的时候是没有问题的。
下面我有写出这个程序文件的全部代码。在8楼!


X我忘记给它设置初始值了!!!不好意!谢谢给位了!

[此贴子已经被作者于2016-3-11 16:38编辑过]

2016-03-10 17:36
l87233203
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2015-3-8
收藏
得分:0 
DO CASE
   CASE x1=x
        DO CASE
           CASE m>0
                IF s<a2*0.895
                   INSERT INTO dmx(xjqs,rq,mz,xz,bm,mc,nz) VALUES (a1,r,m,x,gpdm,gpmc,n)
*!*                   INSERT INTO dmx(xjqs) VALUES (a2)
                ENDIF
               
           CASE m<0
                IF s<a1*0.895
                   INSERT INTO dmx(xjqs,rq,mz,xz,bm,mc,nz) VALUES (a1,r,m,x,gpdm,gpmc,n)                  
*!*                       INSERT INTO dmx(xjqs) VALUES (a1)
                ENDIF
               
        ENDCASE      
   CASE x2=x
        DO CASE
           CASE m>0
               
                IF s<b2*0.895
                   INSERT INTO dmx(xjqs) VALUES (b2)
                ENDIF
               
           CASE m<0
                IF s<b1*0.895
                   INSERT INTO dmx(xjqs) VALUES (b1)
                ENDIF
               
        ENDCASE
   CASE x3=x
        DO CASE
           CASE m>0
                IF s<c2*0.895
                   INSERT INTO dmx(xjqs) VALUES (c2)
                ENDIF
               
           CASE m<0
                IF s<c1*0.895               
                   INSERT INTO dmx(xjqs) VALUES (c1)
                ENDIF
               
        ENDCASE
   CASE x4=x
        DO CASE
           CASE m>0
                IF s<d2*0.895
                   INSERT INTO dmx(xjqs) VALUES (d2)
                ENDIF
               
           CASE m<0
                IF s<d1*0.895
                   INSERT INTO dmx(xjqs) VALUES (d1)
                ENDIF
               
        ENDCASE
   CASE x5=x
        DO CASE
           CASE m>0
                IF s<e2*0.895
                   INSERT INTO dmx(xjqs) VALUES (e2)
                ENDIF
               
           CASE m<0
                IF s<e1*0.895
                   INSERT INTO dmx(xjqs) VALUES (e1)
                ENDIF
               
        ENDCASE  
ENDCASE
*!*             上面的代码在下面也出现了,为啥有上的代码就出错呢???(不是在写程序里面,而是在连编好EXE软件后,运行EXE软件才出现的)上面的好像没有出错,能编写成EXE文件
但是在编写好的数据库.EXE软件里运行,就出现了我要问的问题了。连编应用程序的时候是没问题的。

*!*    下面是文件尾的测试

*!*    SELECT dmm
IF EOF()

DO CASE
   CASE x1=x
      IF m>0
         DO CASE
            CASE v2=x1
                 v=bb1
            CASE v2=x2
                 v=vv
            CASE v2=x3
                 v=vv
         ENDCASE
         IF a2<=v*1.05
            x='V'
         ENDIF
         INSERT INTO dmx(ssqs,rq,mz,xz,bm,mc,nz) VALUES (a2,r,m,x,gpdm,gpmc,n)
      ELSE
         DO CASE
            CASE v2=x1
               v=bb2
            CASE v2=x2
               v=w
            CASE v2=x3
               v=w
          ENDCASE         
         IF a1>=v*0.95
            x='W'
         ENDIF      
         INSERT INTO dmx(xjqs,rq,mz,xz,bm,mc,nz) VALUES (a1,r,m,x,gpdm,gpmc,n)
      ENDIF
      
   CASE x2=x
      IF m>0
         INSERT INTO dmx(zrhc,rq,mz,xz,bm,mc,nz) VALUES (b2,r,m,x,gpdm,gpmc,n)
      ELSE
         INSERT INTO dmx(zrhs,rq,mz,xz,bm,mc,nz) VALUES (b1,r,m,x,gpdm,gpmc,n)
      ENDIF
      
   CASE x3=x
      IF m>0
         INSERT INTO dmx(zrhs,rq,mz,xz,bm,mc,nz) VALUES (c2,r,m,x,gpdm,gpmc,n)
      ELSE
         INSERT INTO dmx(zrhc,rq,mz,xz,bm,mc,nz) VALUES (c1,r,m,x,gpdm,gpmc,n)
      ENDIF
      
   CASE x4=x
   IF m>0
      IF d2<bb2
         x='X'
         INSERT INTO dmx(zrhc,rq,mz,xz,bm,mc,nz) VALUES (b2,r,m,x,gpdm,gpmc,n)
      ELSE
         INSERT INTO dmx(cjhc,rq,mz,xz,bm,mc,nz) VALUES (d2,r,m,x,gpdm,gpmc,n)
      ENDIF
   ELSE
      IF d1>bb1
         x='Y'
         INSERT INTO dmx(zrhs,rq,mz,xz,bm,mc,nz) VALUES (b1,r,m,x,gpdm,gpmc,n)
      ELSE
         INSERT INTO dmx(cjhs,rq,mz,xz,bm,mc,nz) VALUES (d1,r,m,x,gpdm,gpmc,n)
      ENDIF
   ENDIF
     
   CASE x5=x
      IF m>0
         IF e2<=a2
            IF e2>p
               x='Z'
               INSERT INTO dmx(zrhs,rq,mz,xz,bm,mc,nz) VALUES (c2,r,m,x,gpdm,gpmc,n)   
            ELSE
               INSERT INTO dmx(cjhs,rq,mz,xz,bm,mc,nz) VALUES (e2,r,m,x,gpdm,gpmc,n)
            ENDIF
         ENDIF
      ELSE
         IF e1>=a1
            IF e1<p
               x='Z'   
               INSERT INTO dmx(zrhc,rq,mz,xz,bm,mc,nz) VALUES (c1,r,m,x,gpdm,gpmc,n)
            ELSE
               INSERT INTO dmx(cjhc,rq,mz,xz,bm,mc,nz) VALUES (e1,r,m,x,gpdm,gpmc,n)
            ENDIF
         ENDIF
      ENDIF
   
ENDCASE

*!*    RETURN
RETURN TO mainfx
*!*    RETURN TO MASTER
ENDIF


[此贴子已经被作者于2016-3-11 11:52编辑过]

2016-03-11 11:45
快速回复:看下代码有问题吗?
数据加载中...
 
   



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

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