nagarajuj / loon-simple

Automatically exported from code.google.com/p/loon-simple
0 stars 0 forks source link

if-else if-else脚本执行出错 #55

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
BUG描述:版本0.3.1.7中,脚本Command类中doExecute()处理if - else if 
- else语句时出错,命令脚本逐行执行。当if判断成立,else 
if不成立时,最后的else会紧跟上一个else 
if去判断,结果因为else 
if不成立,而else变成了成立,但却忽略了之前if的结果已经成
立......造成多结果出现.

What steps will reproduce the problem?
例如:执行脚本
if 2>=1
 mes 10
else if 3<2
 mes 20
else
 mes 30
endif

What is the expected output? What do you see instead?
实际结果:
mes 10
mes 30
正确预期结果应该为:
mes 10

What version of the product are you using? On what operating system?
版本0.3.1.7
windows

Please provide any additional information below.
个人感觉:
1.添加一个获得结果状态标识,当分支中获得结果后,之后的
结果忽略。。。
2.希望作者能在文档中注明以下一些简单的问题:
 (1)if-else if中的if条件和else if条件不要都为true,如果都为true的话,加上else就会执行3条结果语句
  (2)对于结束的分支语句,当脚本没有写时,最好也能够自动处理endif

Original issue reported on code.google.com by 719976...@qq.com on 10 Aug 2011 at 9:02