if错误写法的灾难性后果
来源:互联网 发布:语音聊天软件 编辑:程序博客网 时间:2024/04/29 11:07
请看下面4个按钮事件
test_btn.onRelease = function() {
var i = 5;
var j = 0;
for (j=1; j<=i; j++) {
if (j == 4) {
trace("j=Four");
} else {
trace("j="+j);
}
}
};
test2_btn.onRelease = function() {
var j = 4;
if (j=4) {
trace("j=Four");
} else {
trace("j="+j);
}
};
test3_btn.onRelease = function() {
var i = 5;
var j = 0;
for (j=1; j<=i; j++) {
if (j=4) {
trace("j=Four");
} else {
trace("j="+j);
}
}
};
test4_btn.onRelease = function() {
var i = 5;
var j = 0;
while (j<=i) {
if (j=4) {
trace("j=Four");
} else {
trace("j="+j);
}
j++;
}
};
你会发现只要执行和的事件,就会造成FLASH程序无法正确执行,而本机的CPU占用率100%,这就是if中条件的错误写法(“if (j=4) {”应该写成“if (j==4) {”)和循环共同作用的结果。
- if错误写法的灾难性后果
- if not exist的灾难性后果
- Javascript 的灾难性错误。
- VS2010出现灾难性错误的解决办法
- Myeclipse安装-灾难性错误
- ActiveX控件调抛出异常灾难性错误的一个解决方法
- ORACLE IF ELSEIF的写法
- <c:if 的正确写法
- shell--if正则的写法
- if if 与if else if 引发的错误
- 正则表达式的灾难性回溯
- s:if的用法 test的写法
- jstl<c:if></c:if>判断的写法
- struts2标签的if标签写法
- “#if 1”这种写法的作用
- Oracle if else 语句的写法实例
- java if判断的另一种写法
- Python if 和 for 的多种写法
- D3DXQuaternionRotationAxis 函数
- some error of the Oracle connection TNS-03505 OR TNS-12541(原创)
- 人生之本
- 作文常用句式
- 一个正则表达式的网站
- if错误写法的灾难性后果
- [整理,编辑] 什么是设计模式?
- D o t N e t 相关资源
- 最新六级听力命题趋势
- D3DXQuaternionRotationMatrix 函数
- D3DXQuaternionRotationYawPitchRoll 函数
- D3DXQuaternionSlerp 函数
- 说说王小波
- C#中Image类分析