• 今天才发现,自已犯了一个低级的逻辑错误,不可原谅


    一个应用提交审核几天了,晚上在斗地主突然弹出提示,审核没有通过:因应用中一个页面显示为空白页。

    我当时就晕了,之前测试的时候也有一二个用户跟我反应过,我当时没太注意,因为我这边测试正常。

    开始一行一行查代码,找原因,花了差不多一个小时,终于找到原因: 一个低级的逻辑错误。

    m = 0
    n = 1
      
    if m = 0 then
        response.write("m 等于 0")
    
    
    else
      
        response.write("m 不等于 0")
          
          
        if n = 1 then
      
            response.write("n 等于 1") '当 m = 0时,这行永远得不到执行        
      
        end if
      
      
        response.end
      
    end if
    
    
    

    正确的逻辑:

    if m = 0 then
     
        response.write("m 等于 0")
         
    else
     
        response.write("m 不等于 0")
     
    end if
     
    if n = 1 then
     
        response.write("n 等于 1") '这样才不会受到 m 值的影响
     
    end if



    2013-04-10

  • 相关阅读:
    备忘
    基于ZooKeeper实现分布式锁
    git 使用ssh密钥
    git 的安装及使用
    sqlalchemy 使用pymysql连接mysql 1366错误
    SQL语句及5.7.2 mysql 用户管理
    C 实现快速排序
    C 实现冒泡排序
    C 实现选择排序
    sqlalchemy orm 操作 MySQL
  • 原文地址:https://www.cnblogs.com/personnel/p/4584879.html
Copyright © 2020-2023  润新知