| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1039 人关注过本帖
标题:下面這段程序代碼,運行時報嵌套錯誤,請各位高手分析一下
只看楼主 加入收藏
张玉春
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2010-7-27
结帖率:0
收藏
 问题点数:0 回复次数:7 
下面這段程序代碼,運行時報嵌套錯誤,請各位高手分析一下
SET PROC TO GT1.PRG


*SET TALK OFF
SET COLOR TO 7/1
CLEAR
CLEAR ALL
DO WHILE .T.
   SET COLOR TO 7+/2
   @12,24 PROMPT ' ? 连续输入 '
   @12,41 PROMPT ' ? 选择输入 '
   MENU TO K
   DO CASE
      CASE K=1
*           DH1='*'
*           DH2=' '
           DO LXSR
      CASE K=2
           DH1=' '
           DH2='*'
      OTHE
           LOOP
   ENDCASE
   EXIT
ENDDO




PROC LXSR
SET COLOR TO 7/1
CLEAR
SELE 1
USE RSK
SELE 2
USE KQK
SET RELA TO RECNO() INTO A
DO RQ
@0,12 SAY '修改岗贴'
X=3
Y=0
Z=0
*&DH1 DO WHILE .T.
        DO WHILE .T.           
           DO CASE
              CASE Z=0
                   SET COLOR TO 7+/2
              CASE Z=1
                   SET COLOR TO 7+/4
              CASE Z=2
                   SET COLOR TO 7+/3
              CASE Z=3
                   SET COLOR TO 7+/6
              CASE Z=4
                   SET COLOR TO 7+/2
           ENDCASE
             @X,8+Y SAY '┏━━━━━━━━┓'
           @X+1,8+Y SAY '┃    岗位津贴    ┃'
           @X+2,8+Y SAY '┃ ============== ┃'
           @X+3,8+Y SAY '┃ 姓名           ┃'
           @X+4,8+Y SAY '┃ 编号           ┃'
           @X+5,8+Y SAY '┃ 甲级           ┃'
           @X+6,8+Y SAY '┃ 乙级           ┃'
           @X+7,8+Y SAY '┃ 丙级           ┃'
           @X+8,8+Y SAY '┃ 合计           ┃'
           @X+9,8+Y SAY '┃ 金额         ?┃'
           @X+10,8+Y SAY '┃            ??┃'
           @X+11,8+Y SAY '┗━━━━━━━━┛'
           J='    '
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           SET COLOR TO 7+/6
           @21,60 SAY ' ? 退出按回车键 '
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 修改第几条记录? ' GET J
           READ
           IF J='    '
              SET COLOR TO 7/1
              CLEAR
              CLEAR ALL
              PUBL RROW, CCOL
              RROW=2
              CCOL=5
              RETURN
           ENDIF
           GO TOP
           SKIP VAL(J)-1
           IF EOF()
              GO BOTTOM
           ENDIF
           DO CASE
              CASE Z=0
                   SET COLOR TO 0/2
              CASE Z=1
                   SET COLOR TO 0/4
              CASE Z=2
                   SET COLOR TO 0/3
              CASE Z=3
                   SET COLOR TO 0/6
              CASE Z=4
                   SET COLOR TO 0/2
           ENDCASE
           @X+3,16+Y SAY RS2
           @X+4,16+Y SAY A->RS1
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           J='Y'
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 不正确键入N,确认按回车键! ' GET J
           READ
           IF UPPER(J)='N'
              LOOP
           ELSE
              EXIT
           ENDIF
           
        ENDDO
        SET COLOR TO 7/1
        @21,0 SAY SPACE(80)
     DO WHILE .T.                 
        XG='N'
        DO WHILE UPPE(XG)='N'           
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 甲级天数:' GET GX13
           READ
           SET COLOR TO 7+/6
           @21,22 SAY ' ? 乙级天数:' GET GX14
           READ
           SET COLOR TO 7+/6
           @21,42 SAY ' ? 丙级天数:' GET GX15
           READ
           HJTS=GX13+GX14+GX15
           IF HJTS>=50.OR.GX13<0.OR.GX14<0.OR.GX15<0
              LOOP
           ENDIF
           HJJE=GX13*1.1+GX14*0.9+GX15*0.7
           DO CASE
              CASE Z=0
                   SET COLOR TO 0/2
              CASE Z=1
                   SET COLOR TO 0/4
              CASE Z=2
                   SET COLOR TO 0/3
              CASE Z=3
                   SET COLOR TO 0/6
              CASE Z=4
                   SET COLOR TO 0/2
           ENDCASE
           @X+5,17+Y SAY GX13 PICT '@Z'
           @X+6,17+Y SAY GX14 PICT '@Z'
           @X+7,17+Y SAY GX15 PICT '@Z'
           @X+8,16+Y SAY HJTS PICT '999'
           @X+9,16+Y SAY HJJE PICT '999.99'
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           @20,0 SAY ' '
           SET COLOR TO 7+/6
           WAIT ' ? 不正确键入N,确认按回车键! ' TO XG
           SET COLOR TO 7/1
           @21,0 SAY SPACE(60)           
        ENDDO
        REPL GX16 WITH HJJE
        @20,0 SAY ' '
        SET COLOR TO 7+/6
        WAIT ' ? 退出键入Q,按回车键继续! ' TO N
        IF UPPER(N)='Q'
           EXIT
        ELSE
           X=X+1
           Y=Y+10
           Z=Z+1
           DO CASE
              CASE Z=1
                   SET COLOR TO 7+/4
              CASE Z=2
                   SET COLOR TO 7+/3
              CASE Z=3
                   SET COLOR TO 7+/6
              CASE Z=4
                   SET COLOR TO 7+/2
              CASE Z>4
                   SET COLOR TO 7+/2
                   X=3
                   Y=0
                   Z=0
           ENDCASE
*&DH1       LOOP
       SKIP
       IF .NOT. EOF()
           @X,8+Y SAY '┏━━━━━━━━┓'   
           @X+1,8+Y SAY '┃    岗位津贴    ┃'
           @X+2,8+Y SAY '┃ ============== ┃'
           @X+3,8+Y SAY '┃ 姓名           ┃'
           @X+4,8+Y SAY '┃ 车间           ┃'
           @X+5,8+Y SAY '┃ 甲级           ┃'
           @X+6,8+Y SAY '┃ 乙级           ┃'
           @X+7,8+Y SAY '┃ 丙级           ┃'
           @X+8,8+Y SAY '┃ 合计           ┃'
           @X+9,8+Y SAY '┃ 金额         ?┃'
           @X+10,8+Y SAY '┃            ??┃'
           @X+11,8+Y SAY '┗━━━━━━━━┛'
               DO CASE
                  CASE Z=0
                       SET COLOR TO 0/2
                  CASE Z=1
                       SET COLOR TO 0/4
                  CASE Z=2
                       SET COLOR TO 0/3
                  CASE Z=3
                       SET COLOR TO 0/6
                  CASE Z=4
                       SET COLOR TO 0/2
               ENDCASE
               @X+3,16+Y SAY RS2
               @X+4,16+Y SAY A->RS1
*               LOOP
           ELSE
*&DH2          SET COLOR TO 7/1
*&DH2          @21,0 SAY SPACE(80)
*&DH2          @20,0 SAY ' '
*&DH2          SET COLOR TO 7+/6
*&DH2          WAIT ' ? 最后一条记录修改完毕,按回车键返回! '
*&DH2          EXIT
*&DH2       ENDIF
          SET COLOR TO 7/1
          @21,0 SAY SPACE(80)
          @20,0 SAY ' '
          SET COLOR TO 7+/6
          WAIT ' ? 最后一条记录修改完毕,按回车键返回! '
          EXIT
       ENDIF      
         *ENDIF
ENDDO
SET COLOR TO 7/1
CLEAR
CLEAR ALL
PUBL RROW, CCOL
RROW=2
CCOL=4
RETURN

搜索更多相关主题的帖子: 嵌套 
2010-07-28 19:55
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:0 
看着如此“古老”的程序代码,我真不知道该说些什么!
初步看了一下,请楼主将do while .t.后面的“ ”删除试试。

        SET COLOR TO 7/1
        @21,0 SAY SPACE(80)
     DO WHILE .T.                 
        XG='N'
        DO WHILE UPPE(XG)='N'           
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 甲级天数:' GET GX13
           READ
           SET COLOR TO 7+/6
           @21,22 SAY ' ? 乙级天数:' GET GX14
           READ
           SET COLOR TO 7+/6
           @21,42 SAY ' ? 丙级天数:' GET GX15

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2010-07-28 20:21
茵梦湖
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:31
帖 子:545
专家分:2180
注 册:2009-4-25
收藏
得分:0 
     ...
     ...
     ...
     DO WHILE .T.      
        XG='N'
        DO WHILE UPPE(XG)='N'           
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 甲级天数:' GET GX13
           ...
           ...
           ...
        ENDDO
        REPL GX16 WITH HJJE
        @20,0 SAY ' '
        SET COLOR TO 7+/6
        WAIT ' ? 退出键入Q,按回车键继续! ' TO N
        IF UPPER(N)='Q'  && 你这里的 if 少了endif 配套
           EXIT
        ELSE
           X=X+1
           Y=Y+10
           Z=Z+1
           ...
           ...
           ...
       IF .NOT. EOF()
           @X,8+Y SAY '┏━━━━━━━━┓'   
           @X+1,8+Y SAY '┃    岗位津贴    ┃'
           @X+2,8+Y SAY '┃ ============== ┃'
           ...
           ...
           ...
           ELSE
*&DH2          SET COLOR TO 7/1
*&DH2          @21,0 SAY SPACE(80)
*&DH2          @20,0 SAY ' '
           ...
           ...
           ...
       ENDIF      
         *ENDIF
ENDDO
SET COLOR TO 7/1
CLEAR
CLEAR ALL
PUBL RROW, CCOL
RROW=2
CCOL=4
RETURN
2010-07-28 20:50
茵梦湖
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:31
帖 子:545
专家分:2180
注 册:2009-4-25
收藏
得分:0 
以下是引用hu9jj在2010-7-28 20:21:56的发言:

看着如此“古老”的程序代码,我真不知道该说些什么!
初步看了一下,请楼主将do while .t.后面的“ ”删除试试。

        SET COLOR TO 7/1
        @21,0 SAY SPACE(80)
     DO WHILE .T.                 
        XG='N'
        DO WHILE UPPE(XG)='N'           
           SET COLOR TO 7/1
           @21,0 SAY SPACE(80)
           SET COLOR TO 7+/6
           @21,2 SAY ' ? 甲级天数:' GET GX13
           READ
           SET COLOR TO 7+/6
           @21,22 SAY ' ? 乙级天数:' GET GX14
           READ
           SET COLOR TO 7+/6
           @21,42 SAY ' ? 丙级天数:' GET GX15


我倒是很看好楼主的~~~  
 
能写出这样代码的人, 只要稍微熟悉一下vfp, 就绝对比这个坛子里的大部分人都要强~~~ 我这样说, 估计这个坛子里的许多人可能会不太服气~~~
 
 
 
 
 

 
 

2010-07-28 21:01
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:0 
我猜测:这段代码不是楼主写的,如果能写出这些代码,那末排除嵌套问题应该不是很困难的。结合楼主发的几个求助贴判断,楼主仅仅是刚接触FoxBASE的初学者。最让我感到无话可说的是现在竟然还有教初学者学习古老的FoxBASE的,难道VFP一定要从FoxBASE学起不成。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2010-07-29 20:43
panpende
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:4
帖 子:528
专家分:963
注 册:2009-4-27
收藏
得分:0 
我也熟悉这些代码,我也是从FoxBASE开始的。我至今还喜欢不用表单的用纯代码写成的程序。甚至怀念不用报表的用纯代码写成的打印程序。
2010-07-30 15:52
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:0 
好像最后一个语句的前面少了一个enddo。

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2010-07-30 22:06
zhuhuiling
Rank: 2
等 级:论坛游民
帖 子:7
专家分:28
注 册:2010-6-28
收藏
得分:0 
结构没有问题,楼主根据 2楼的建议试试。
2010-08-02 17:58
快速回复:下面這段程序代碼,運行時報嵌套錯誤,請各位高手分析一下
数据加载中...
 
   



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

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