| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 630 人关注过本帖
标题:超级菜鸟求救合并问题,很着急,请高手们进来小帮助下小菜吧!
只看楼主 加入收藏
rax
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-8-30
收藏
 问题点数:0 回复次数:2 
超级菜鸟求救合并问题,很着急,请高手们进来小帮助下小菜吧!
我是很菜的,我想把下面的两段代码合并为一段,我没学过什么电脑语言,所以请高手们不要说这语法错误,哪语句错误,我只希望你们能够给我修改下,发出合并后的代码,再次感谢!!

第一段代码如下:
                        cid = Session("cid")
                        set rs=server.createobject("adodb.recordset")
                        sql="select top 15 * from [charac0] where c_id='"&cid&"'"
                         rs.open sql,conn,1,1
                        att = split(rs("m_body"),"\_1SKILL=")
                        tem1 = att(0)
                        
                        btt = split(att(1),"\_1PK=")
                        tem2 = btt(1)
                        money = rs("c_sheaderc")
                        career = CInt(rs("c_sheaderb"))
                        
                        if career=0 then
                          petact = "4294967166;4294967166;4294967166"
                                                        
                          elseif career=1 then
            
                          petact = "1065353214;1065353214;1065353214"
                                                        
                          elseif career=2 then
            
                          petact = "4290723710;4290723710;4290723710"
                                                        
                          elseif career=3 then
            
                          petact = "131070;131070;131070"
                                                        
                        end if  
                        cast = 0
                        if money-cast<0 then
                          MSG("您的等级数据错误!")
                          exit sub
                        end if
                        niao = rs("c_headerc")       
                        cast1 = 0
                        if niao-cast1<0 then
                          MSG("您的金钱数据错误!")
                          exit sub
                        end if
            
                        
                        lev=lev+int(adlev)
                        money = money>cast
                                     niao = niao-cast1
                        rlev = rlev
                        
                       att = tem1&"\_1SKILL="&petact&"\_1PK="&tem2
                                        
                        rs.close
                        conn.execute("insert into bak select * from charac0 where c_id='"&cid&"'")
                        conn.execute("update charac0 set m_body='"&att&"', c_headerc='"&niao&"' where c_id='"&cid&"'")
                        call MSG("您的技能学全了")
                        exit sub
                      end sub
                      sub login()



第二段代码如下:

                    cid = Session("cid")
                    set rs=server.createobject("adodb.recordset")
                    sql="select top 15 * from [charac0] where c_id='"&cid&"'"
                    rs.open sql,conn,1,1

                    att = split(rs("m_body"),"\_1INVEN=")                    
                    tem1 = att(0)
                    middle = split(att(1),"\_1PETINV=")
                    tem3 = middle(0)
                    btt = split(middle(1),"\_1SKILLEX=")
                    tem2 = btt(0)
                    ctt = split(btt(1),"\_1SKLSLTEX=")
                    tem4 = ctt(1)
                    money = rs("c_sheaderc")
                    yuwan = split(rs("m_body"),"9682;32;")
                    heihe = split(rs("m_body"),"9913;32;")
                    cast = 0
                    if money-cast<0 then
                      MSG("您的等级数据错误!")
                      exit sub
                    end if
                        niao = rs("c_headerc")
                    cast1 = 0
                    cast2 = 0
                    if petact = "4294967295;0;0" then
                        cast1 = 100000000
                        cast2 =0
                    elseif petact = "4294967295;4294967295;0" then
                        cast1 = 200000000
                        cast2 = 0
                    else
                        cast1 = 300000000
                        cast2=0
                    end if
                    if niao-cast1<0 or ubound(yuwan)-cast2<0 or ubound(heihe)-cast2<0 then
                      MSG("您的金钱或升级物品数量不足!")
                      exit sub
                    end if
                    lev=lev+int(adlev)
                    money = money>cast
                    niao = niao-cast1
                    rlev = rlev
                    att =tem1&"\_1INVEN="&tem3&"\_1PETINV="&tem2&"\_1SKILLEX="&petact&"\_1SKLSLTEX="&tem4
                    rs.close
                    sql = "update charac0 set m_body='"&att&"', c_headerc='"&niao&"' where c_id='"&cid&"'"
                    conn.execute("insert into bak select * from charac0 where c_id='"&cid&"'")
                    conn.execute(sql)
                    
                    call MSG("新技能学习成功!")
                    exit sub
                    
                  end sub
                  sub login()
非常感谢!!!!希望愿帮菜鸟的朋友出现!!!
搜索更多相关主题的帖子: 小菜 超级 
2008-08-30 22:17
rax
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-8-30
收藏
得分:0 
着急啊,在线等,救救我啊。
2008-08-31 08:31
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 
够乱的!

程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2008-08-31 10:17
快速回复:超级菜鸟求救合并问题,很着急,请高手们进来小帮助下小菜吧!
数据加载中...
 
   



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

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